Question: Create an Abstract Data Type (ADT) called DOB_ADT with the fields D, M, and Y all of type INTEGER to store the birth date day,

 Create an Abstract Data Type (ADT) called DOB_ADT with the fields

D, M, and Y all of type INTEGER to store the birth

date day, month, and year respectively. Also, include a function called age

with a return type NUMBER to calculate and return the age. Hint:

Create an Abstract Data Type (ADT) called DOB_ADT with the fields D, M, and Y all of type INTEGER to store the birth date day, month, and year respectively. Also, include a function called age with a return type NUMBER to calculate and return the age. Hint: subtract from the current year, the year of birth. You can get the current year in PL/SQL using the EXTRACT function like this: EXTRACT (YEAR FROM sysdate). Next, create a table called Family Member with the following attributes (the underlined attribute refers to the primary key): Attribute Data Type INTEGER ID ITAP 3371 LABO5 Spring 2021 Name VARCHAR(20) DOB_ADT DOB After this, create a sequence called ID..seg to generate sequential numbers 1,2,3... and use it to generate IDs for the family members at insertion time. Next, insert, in the table Family Member, at least 5 family members (mom, dad, brother, or sister). You may use fake names and birth dates if you prefer not to use the real ones. When your table is populated, use the age function in the DOB_ADT to write a query to display the ID, name, and age of the family members. For example, assume that the Family Member table looks like this: DOB_ADT to write a query to display the ID, name, and age of the family members. For example, assume that the FamilyMember table looks like this: ID Name DOB ======= ========= 1 Peter DOB_ADT(1,1,1965) 2 Mary DOB_ADT(23,2,1970) 3 Ron DOB_ADT(11,6,1995) Then your query should display the following (FAM is just an alias used in the query to represent the FamilyMember table) using the current year 2020: ID NAME FAM.DOB.AGED) 1 Peter 55 2 Mary 50 3 Ron 25 Create an Abstract Data Type (ADT) called DOB_ADT with the fields D, M, and Y all of type INTEGER to store the birth date day, month, and year respectively. Also, include a function called age with a return type NUMBER to calculate and return the age. Hint: subtract from the current year, the year of birth. You can get the current year in PL/SQL using the EXTRACT function like this: EXTRACT (YEAR FROM sysdate). Next, create a table called Family Member with the following attributes (the underlined attribute refers to the primary key): Attribute Data Type INTEGER ID ITAP 3371 LABO5 Spring 2021 Name VARCHAR(20) DOB_ADT DOB After this, create a sequence called ID..seg to generate sequential numbers 1,2,3... and use it to generate IDs for the family members at insertion time. Next, insert, in the table Family Member, at least 5 family members (mom, dad, brother, or sister). You may use fake names and birth dates if you prefer not to use the real ones. When your table is populated, use the age function in the DOB_ADT to write a query to display the ID, name, and age of the family members. For example, assume that the Family Member table looks like this: DOB_ADT to write a query to display the ID, name, and age of the family members. For example, assume that the FamilyMember table looks like this: ID Name DOB ======= ========= 1 Peter DOB_ADT(1,1,1965) 2 Mary DOB_ADT(23,2,1970) 3 Ron DOB_ADT(11,6,1995) Then your query should display the following (FAM is just an alias used in the query to represent the FamilyMember table) using the current year 2020: ID NAME FAM.DOB.AGED) 1 Peter 55 2 Mary 50 3 Ron 25

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!