Consider the following schema:
Pet (petNo, petName, petDescription, dateRegistered, picture, surgeryNo, doctorStaffNo)
Staff (staffNo, sName, sAddress, position, surgeryNo)
Surgery (surgeryNo, surgeryAddress, surgeryTelNo)
where:
Pet contains details of pets and the pet number (petNo) is the key. The surgery where the pet is registered is given by the surgery number (surgeryNo). A pet can only be registered with one surgery at a time. The doctor who treats the pet is given by the doctorStaffNo. Picture contains an image of the pet.
Staff contains details of staff and staff number (staffNo) is the key.
Surgery contains details of each surgery and the surgery number (surgeryNo) is the key.
Now consider the following SQL:2003 query:
SELECT petNo, staffNo
FROM Pet p, TABLE StaffDoctors s
WHERE p.doctorStaffNo = s.staffNo AND
p.brownShortHairedTerrier(picture) AND s.surgeryNo = 'S3' AND
p.dateRegistered < '1-Jan-90';
The routine brownShortHairedTerrier() is an externally defined routine that searches the specified image for certain characteristics. The StaffDoctors() function is fully defined within SQL3 as:
CREATE FUNCTION StaffDoctors() RETURNS SET(Staff)
SELECT * FROM Staff WHERE position = 'Doctor';
Discuss how you would want a query optimiser within an ORDBMS to handle this type of query. Use a relational algebra tree to illustrate your answer.
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q1: Compare and contrast the two manifestos: Object-Oriented
Q2: Discuss how the new version of the
Q3: The on-going debate between proponents of the
Q4: Discuss how the proposed SQL:2011 standard will
Q6: Given the following example of an
Q7: In the Object Relational Model (ORM) an
Q8: Explain the procedures and techniques needed to
Q9: The application prototyping approach to software development
Q10: Explain what is meant by application prototyping
Q11: Explain why planning is important in the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents