Exam 8: Query Processing

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Case Study 3 - Rapid Roads Client \quad \quad (clientNo, cName, cAddress, cTelNo, cFaxNo, officeNo) Unit \quad \quad \quad (unitRegNo, unitDescription, maxPayload, officeNo) Trailer \quad \quad \quad (trailerNo, trailerDescription, trailerLength, maxCarryingWt, officeNo) ClientOrder \quad \quad (orderNo, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription) TransportReq \quad (orderNo, unitRegNo, trailerNo) Staff \quad \quad \quad (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo) Office \quad \quad (officeNo, oAddress, oTelNo, oFaxNo, countryNo) Country \quad \quad (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:
Verified

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 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'; 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:
Verified

Case Study 3 - Rapid Roads Client \quad \quad (clientNo, cName, cAddress, cTelNo, cFaxNo, officeNo) Unit \quad \quad \quad (unitRegNo, unitDescription, maxPayload, officeNo) Trailer \quad \quad \quad (trailerNo, trailerDescription, trailerLength, maxCarryingWt, officeNo) ClientOrder \quad \quad (orderNo, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription) TransportReq \quad (orderNo, unitRegNo, trailerNo) Staff \quad \quad \quad (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo) Office \quad \quad (officeNo, oAddress, oTelNo, oFaxNo, countryNo) Country \quad \quad (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:  Case Study 3 - Rapid Roads Client    \quad \quad  (<u>clientNo</u>, cName, cAddress, cTelNo, cFaxNo, officeNo) Unit    \quad    \quad \quad  (<u>unitRegNo</u>, unitDescription, maxPayload, officeNo) Trailer    \quad    \quad \quad  (<u>trailerNo</u>, trailerDescription, trailerLength, maxCarryingWt, officeNo) ClientOrder   \quad \quad   (<u>orderNo</u>, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription) TransportReq  \quad   (<u>orderNo</u>, <u>unitRegNo</u>, trailerNo) Staff  \quad    \quad    \quad   (<u>staffNo</u>, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo) Office  \quad    \quad   (<u>officeNo</u>, oAddress, oTelNo, oFaxNo, countryNo) Country   \quad    \quad  (<u>countryNo</u>, 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. 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:
Verified

   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:
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:
   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 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. 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: 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. 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 \quad \quad (clientNo, cName, cAddress, cTelNo, cFaxNo, officeNo) Unit \quad \quad \quad (unitRegNo, unitDescription, maxPayload, officeNo) Trailer \quad \quad \quad (trailerNo, trailerDescription, trailerLength, maxCarryingWt, officeNo) ClientOrder \quad \quad (orderNo, clientNo, dateOrder, collectDate, collectAddress, deliveryDate, deliveryAddress, loadWeight, loadDescription) TransportReq \quad (orderNo, unitRegNo, trailerNo) Staff \quad \quad \quad (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, officeNo) Office \quad \quad (officeNo, oAddress, oTelNo, oFaxNo, countryNo) Country \quad \quad (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 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; 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)
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)