Guest User

Untitled

a guest
May 25th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Customer(ID, name, birthDate, city);
  2. Room(number, floor, beds, roomtype, price);
  3. Bookings(Customer, roomNumber, floor, checkInDate, checkOutDate);
  4.  
  5. select Customer from Bookings
  6. join Room on(Bookings.num = camera.roomNumber and Bookings.floor=
  7. Room.floor)
  8. where (Bookings.Customer, Bookings.floor) not in (select number, floor from
  9. Room where roomType != 'economic')
  10.  
  11. select b.Customer
  12. from Bookings b join
  13. Room r
  14. on b.num = r.roomNumber and b.floor = r.floor
  15. group by b.Customer
  16. having min(roomType) = max(roomType) and min(roomType) = 'economic';
Add Comment
Please, Sign In to add comment