Use SQL:2003 with the MULTISET construct to represent a database with UDTs for Person and Employee. Employees are persons and persons have children (use MULTISET to represent the corresponding attribute)

 Provide the appropriate CREATE TABLE statements.
 Write the following query: Find all employees who have at least one child who is also
an employee.


Solution:


CREATE TYPE PersonT AS (
ID INTEGER,
Name CHAR(20),
DOB DATE,
Children Ref( PersonT) MULTISET SCOPE Employee,
REF IS ID
)
CREATE TYPE EmplT UNDER PersonT AS (
Salary INTEGER
)
CREATE TABLE Person OF PersonT
CREATE TABLE Employee OF EmplT

Computer Science & Information Technology

You might also like to view...

The shape attribute of the tag can take any of the following values, except ____.

A. circle B. poly C. triangle D. rect

Computer Science & Information Technology

A(n) ____________________ is a duplicate of content on a storage medium that you can use in case the original is lost, damaged, or destroyed.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The mouse pointer becomes different shapes depending on the pointer's location and locations you click on the screen.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

According to the OSI model, which of the following layers is responsible for providing reliable communication?

A. Data Link B. Transport C. Network D. Session

Computer Science & Information Technology