Consider the relation schema corresponding to the IsA hierarchy in Figure 4.6. Assume that this schema has one relation per entity. (Consult Section 4.4 to refresh your memory about translation of IsA hierarchies into the relational model.) Write the following queries both in tuple and domain relational calculus:
a. Find the names of all sophomores in the computer science major.
b. Find the names of all students in the computer science major.
c. Find all departments where some technician has every specialization that any other technician (in the same or another department) has.
a.
{Name | ?DOB?SSN?Major
(Person(SSN,Name,DOB) AND Sophomore(SSN,Major)) }
b.
{Name | ?DOB?SSN?Major?Advisor (Person(SSN,Name,DOB) AND
(Sophomore(SSN,Major) OR
Junior(SSN,Major) OR
Senior(SSN,Major,Advisor) ) ) }
c. One way to answer this query is to de?ne a view with one attribute, Name:
Specialization = {Spec |?SSN(Technician(SSN, Spec))}
Then we can write the query as
{Department | ?SSN?Salary (Employee(SSN,Department,Salary)
AND ?Spec ? Specialization.Name (Technician(SSN,Spec)) )
Without the use of views, the query would require the implication connective ?:
{Department | ?SSN?Salary (Employee(SSN,Department,Salary)
AND ?Specialization?SSN2 (Technician(SSN2,Specialization)
? Technician(SSN,Specialization)) )
You might also like to view...
Identify the letter of the choice that best matches the phrase or definition.
A. A special effect that is created by reducing the number of colors available for the image B. A visual effect in which the edge of an image-usually an oval-gradually fades away. C. A hard edge D. Saved selections E. A blend, usually at the edge of an image F. G.
____ combine to form DHTML.
A. PHP, HTML, and XML B. XML and HTML C. HTML5, CSS3, and JavaScript D. HTML, CSS3, and PHP