BMGT 402 Lecture Notes - Lecture 16: Aggregate Function, The London Group, Dno
Document Summary
Bmgt402 lecture 16 chapter 6: data manipulation cont. Order by s. branchno, s. staffno: for each hotel (hotel name) list the total number of rooms of each room type and the average price. Room (roomno, hotelno, type, price: weak entity type. , datefrom, dateto, guestno: verb as a name of a table because its derived from a binary relationship. Group by h. hotelname, r. type: for each hotel in london, list the total number of rooms and average price for each room type. Where h. hotelno = r. hotelno and h. city = london". For each hotel list the total number of bookings for each room type. Group by h. hotelname, r. type: for each city list the total number of hotels and the total number of rooms. Order by h. city: for each city list the total number of hotels and the total number of rooms of each type. Select h. city, r. type, count (distinct h. hotelno) as hcnt, count (r. roomno) as rcnt.