Exam 8: Query Processing
Exam 1: Introduction to Databases and Database Environment8 Questions
Exam 2: The Relational Model, Relational Algebra and Relational Calculus9 Questions
Exam 3: SQL: Data Manipulation and Advanced SQL18 Questions
Exam 4: Object-Relational DBMSs, Database Planning, Design, and Administration12 Questions
Exam 5: Entity-Relationship Modeling and Normalization19 Questions
Exam 6: Methodology-Conceptual Database Design and Methodology-Physical Database Design for Relational Databases9 Questions
Exam 7: Security, Administration and Transaction Management12 Questions
Exam 8: Query Processing8 Questions
Exam 9: Distributed DBMSs Concepts and Design10 Questions
Exam 10: Distributed DBMSs-Advanced Concepts and Object-Oriented DBMSs-Concepts and Design14 Questions
Exam 11: Object-Oriented DBMSs-Standards and Systems7 Questions
Exam 12: Web Technology and DBMSs, Semistructured Data and XML and Data Warehousing Concepts18 Questions
Exam 13: Data Warehousing Design15 Questions
Exam 14: OLAP and Data Mining11 Questions
Select questions type
Case Study 3 - Rapid Roads
Client (clientNo, cName, cAddress, cTelNo, cFaxNo, officeNo)
Unit (unitRegNo, unitDescription, maxPayload, officeNo)
Trailer (trailerNo, trailerDescription, trailerLength, maxCarryingWt, officeNo)
ClientOrder (orderNo, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription)
TransportReq (orderNo, unitRegNo, trailerNo)
Staff (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo)
Office (officeNo, oAddress, oTelNo, oFaxNo, countryNo)
Country (countryNo, countryName)
For a more complete description, see Case Study 5 under Chapter 22.
-Using the above relational schema, determine whether the following query is both type and semantically correct:
SELECT CO.clientNo, cAddress
FROM TransportReq TR, ClientOrder CO, Client C, Unit U, Trailer T
WHERE CO.clientNo = C.clientNo AND
TR.unitRegNo = U.unitRegNo AND
TR.trailerNo = T.trailerNo AND
maxCarryingWt < maxPayload AND
LoadWeight < maxPayload;
Free
(Essay)
4.8/5
(36)
Correct Answer:
Query graph will show that the join graph is connected to the Result. Should conclude that it is semantically correct.
Case Study 2 - Complete Pet Care
For a more complete description, see Case Study 4 under Chapter 22.
-Consider the above relational schema. Map the following query onto a relational algebra tree, and then transform it into a reduced query.Give a full explanation of the reasoning behind each step and state any transformation rules used during the reduction process.
SELECT P.petNo, petName, oName, oAddress
FROM Pet P, Owner O, Prescription P, Medication M
WHERE PR.medNo = M.medNo AND
PR.petNo = P.petNo AND
P.ownerNo = O.ownerNo AND
medName = ' Provac' AND
unitsPerDay > 200 AND
petDescription = 'Setter';

Free
(Essay)
4.8/5
(32)
Correct Answer:
Case Study 3 - Rapid Roads
Client (clientNo, cName, cAddress, cTelNo, cFaxNo, officeNo)
Unit (unitRegNo, unitDescription, maxPayload, officeNo)
Trailer (trailerNo, trailerDescription, trailerLength, maxCarryingWt, officeNo)
ClientOrder (orderNo, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription)
TransportReq (orderNo, unitRegNo, trailerNo)
Staff (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo)
Office (officeNo, oAddress, oTelNo, oFaxNo, countryNo)
Country (countryNo, countryName)
For a more complete description, see Case Study 5 under Chapter 22.
-Now assume that the relation Trailer given in Question 20.7 is horizontally fragmented as follows:
Transform the relational algebra tree from Question 21.7 into a reduced query on fragments. Give a full explanation of the reasoning behind each step and state any transformation rules used during the reduction process.

Free
(Essay)
4.7/5
(38)
Correct Answer:
Using the fact that the Selection operation on (officeNo = 2) will not produce any tuples from T1 and T3, this will simplify to the following tree:
Case Study 1 - InstantBuy
Client (clientNo, cName, cAddress, cTelNo, cFaxNo, sex, DOB, officeNo)
Item (itemNo, itemDescription, itemSize, itemColor, itemPrice, itemType)
ItemType (itemType, typeDescription)
ClientOrder (orderNo, clientNo, dateOrder, dateDeliver)
OrderDetail (orderNo, itemNo, noOfItems)
Staff (staffNo, sName, sAddress, sTelNo, sex, DOB, NIN, taxCode, salary, officeNo)
Office (officeNo, oAddress, oTelNo, oFaxNo, mgrStaffNo, areaNo)
Area (areaNo, areaDescription)
For a more complete description, see Case Study 3 under Chapter 22.
-Using the above relational schema, determine whether the following query is both type and semantically correct:
SELECT CO.orderNo, C.cAddress, OD.itemNo
FROM OrderDetail OD, ClientOrder CO, Client C, Office O, Area A
WHERE CO.clientNo = C.clientNo AND
C.officeNo = O.officeNo AND
O.areaNo = A.areaNo AND
A.areaDescription = 'SE' AND
C.cName = 'J. Smith';
(Essay)
4.8/5
(38)
Case Study 2 - Complete Pet Care
For a more complete description, see Case Study 4 under Chapter 22.
-Now assume that the relation Medication given in Question 20.4 is horizontally fragmented as follows:
Transform the relational algebra tree from Question 20.4 into a reduced query on fragments. Give a full explanation of the reasoning behind each step and state any transformation rules used during the reduction process.


(Essay)
4.8/5
(33)
Case Study 3 - Rapid Roads
Client (clientNo, cName, cAddress, cTelNo, cFaxNo, officeNo)
Unit (unitRegNo, unitDescription, maxPayload, officeNo)
Trailer (trailerNo, trailerDescription, trailerLength, maxCarryingWt, officeNo)
ClientOrder (orderNo, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription)
TransportReq (orderNo, unitRegNo, trailerNo)
Staff (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo)
Office (officeNo, oAddress, oTelNo, oFaxNo, countryNo)
Country (countryNo, countryName)
For a more complete description, see Case Study 5 under Chapter 22.
-Consider the above relational schema. Map the following query onto a relational algebra tree, and then transform it into a reduced query:
SELECT trailerDescription, unitDescription
FROM Trailer T, Unit U, Office O, TransportReq TR
WHERE TR.trailerNo = T.trailerNo AND
TR.unitRegNo = U.unitRegNo AND
U.officeNo = O.officeNo AND
maxPayload > maxCarryingWt AND
O.officeNo = 2;
Give a full explanation of the reasoning behind each step and state any transformation rules used during the reduction process.
(Essay)
4.8/5
(31)
Case Study 2 - Complete Pet Care
For a more complete description, see Case Study 4 under Chapter 22.
-Using the above relational schema, determine whether the following query is both type and semantically correct:
SELECT P.petNo, petName, oName, O.TelNo
FROM Pet P, Owner O, Prescription Pr, Medication M, Surgery S
WHERE Pr.medNo = M.medNo AND
S.surgeryNo = O.surgeryNo AND
PR.petNo = P.petNo AND
P.ownerNo = O.ownerNo AND
M.medNo = 'J. Smith' AND adminMethod = 'Oral' AND
S.surgeryNo = 100;

(Essay)
4.8/5
(40)
Case Study 1 - InstantBuy
Client (clientNo, cName, cAddress, cTelNo, cFaxNo, sex, DOB, officeNo)
Item (itemNo, itemDescription, itemSize, itemColor, itemPrice, itemType)
ItemType (itemType, typeDescription)
ClientOrder (orderNo, clientNo, dateOrder, dateDeliver)
OrderDetail (orderNo, itemNo, noOfItems)
Staff (staffNo, sName, sAddress, sTelNo, sex, DOB, NIN, taxCode, salary, officeNo)
Office (officeNo, oAddress, oTelNo, oFaxNo, mgrStaffNo, areaNo)
Area (areaNo, areaDescription)
For a more complete description, see Case Study 3 under Chapter 22.
-Consider the above relational schema. Map the following query onto a relational algebra tree, and then transform it into a reduced query.Give a full explanation of the reasoning behind each step and state any transformation rules used during the reduction process.
SELECT CO.orderNo, C.cAddress, O.oAddress
FROM ClientOrder CO, Client C, Office O, Area A
WHERE CO.clientNo = C.clientNo AND
C.officeNo = O.officeNo AND
CO.dateDeliver < '1-Jun-96' AND
O.areaNo = A.areaNo AND
A.areaDescription = 'NE' AND
C.cName = 'J. Smith' AND
CO.dateOrder > '1-Jan-96';
(Essay)
4.8/5
(30)
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)