Using the Hotel schema given at the start of the Exercises at the end of Ch
Using the Hotel schema given at the start of the Exercises at the end of Chapter 3, determine whether the following queries are semantically correct:
(a) SELECT r.type, r.price
FROM Room r, Hotel h
WHERE r.hotel_number = h.hotel_number AND h.hotel_name = ‘Grosvenor Hotel’ AND r.type > 100;
(b) SELECT g.guestNo, g.name
FROM Hotel h, Booking b, Guest g
WHERE h.hotelNo = b.hotelNo AND h.hotelName = ‘Grosvenor Hotel’;
(c) SELECT r.roomNo, h.hotelNo
FROM Hotel h, Booking b, Room r
WHERE h.hotelNo = b.hotelNo AND h.hotelNo = ‘H21’ AND b.roomNo = r.roomNo AND
type = ‘S’ AND b.hotelNo = ‘H22’;
Answers
Status NEW
Posted 25 May 2017 10:05 AM
My Price 7.00
-----------
Attachments
file 1495709171-Answer.docx preview (179 words )
U-----------sin-----------g t-----------he -----------Hot-----------el -----------sch-----------ema----------- gi-----------ven----------- at----------- th-----------e s-----------tar-----------t o-----------f t-----------he -----------Exe-----------rci-----------ses----------- at----------- th-----------e e-----------nd -----------of -----------Cha-----------pte-----------r 3-----------, d-----------ete-----------rmi-----------ne -----------whe-----------the-----------r t-----------he -----------fol-----------low-----------ing----------- qu-----------eri-----------es -----------are----------- se-----------man-----------tic-----------all-----------y c-----------orr-----------ect-----------: -----------(a)----------- SE-----------LEC-----------T r-----------.ty-----------pe,----------- r.-----------pri-----------ce ----------- FR-----------OM -----------Roo-----------m r-----------, H-----------ote-----------l h----------- W-----------HER-----------E r-----------.ho-----------tel-----------_nu-----------mbe-----------r =----------- h.-----------hot-----------el_-----------num-----------ber----------- AN-----------D h-----------.ho-----------tel-----------_na-----------me -----------= â-----------€˜G-----------ros-----------ven-----------or -----------Hot-----------elâ-----------€™ -----------AND----------- r.-----------typ-----------e &-----------amp-----------;gt-----------; 1-----------00;----------- (-----------b) -----------SEL-----------ECT----------- g.-----------gue-----------stN-----------o, -----------g.n-----------ame----------- F-----------ROM----------- Ho-----------tel----------- h,----------- Bo-----------oki-----------ng -----------b, -----------Gue-----------st -----------g -----------WHE-----------RE -----------h.h-----------ote-----------lNo----------- = -----------b.h-----------ote-----------lNo----------- AN-----------D h-----------.ho-----------tel-----------Nam-----------e =----------- â€-----------˜Gr-----------osv-----------eno-----------r H-----------ote-----------lâ€-----------™;
Not Rated(0)