Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Nama : Raymond Niu

Nim : 825230147

No.1

(a) ΠhotelNo(σprice > 50(Room))

Hasilnya adalah kumpulan nomor hotel (hotelNo) di mana harga kamar (price) lebih dari 50.

(b) σHotel.hotelNo = Room.hotelNo(Hotel × Room)

Hasilnya adalah gabungan antara tabel Hotel dan tabel Room di mana hotelNo di kedua tabel tersebut
sama.

(c) ΠhotelName(Hotel Hotel.hotelNo = Room.hotelNo(σprice > 50(Room)))

Hasilnya adalah kumpulan nama hotel (hotelName) di mana harga kamar (price) lebih dari 50 dan
hotelNo di tabel Hotel sama dengan hotelNo di tabel Room.

(d) Guest (σdateTo ≥ ‘1-Jan-2019’(Booking))

Hasilnya adalah kumpulan data tamu (Guest) di mana tanggal penghunian (dateTo) lebih besar atau
sama dengan 1-Jan-2019 di dalam tabel Booking.

(e) Hotel Hotel.hotelNo = Room.hotelNo(σprice > 50(Room))

Hasilnya adalah gabungan antara tabel Hotel dan tabel Room di mana hotelNo di kedua tabel tersebut
sama dan harga kamar (price) lebih dari 50.

(f) ΠguestName, hotelNo(Booking Booking.guestNo = Guest.guestNo Guest) ÷ ΠhotelNo(σcity =


‘Jakarta’(Hotel))

No.2

(a) List all hotels.

ΠhotelNo, hotelName, city(Hotel)


(b) List all single rooms with a price below £50 per night.

σroomType = 'single' ∧ price < 50(Room)

(c) List the names and cities of all guests.

ΠguestName, city(Guest)

(d) List the price and type of all rooms at the Aston Hotel.

Πprice, roomType(Room σhotelNo = 'Aston Hotel'(Hotel))

(e) List all guests currently staying at the Aston Hotel.

Guest σguestNo = guestNo(Guest σhotelNo = 'Aston Hotel'(Booking))

(f) List the details of all rooms at the Aston Hotel, including the name of the guest staying in the room, if
the room is occupied.

Room ⨝guestNo = guestNo(Booking σhotelNo = 'Aston Hotel'(Guest))

(g) List the guest details (guestNo, guestName, and guestAddress) of all guests staying at the Aston Hotel.

ΠguestNo, guestName, guestAddress(Guest σguestNo = guestNo(Booking σhotelNo = 'Aston


Hotel'(Guest)))

You might also like