Details

This homework involves initilaizing a database schema using the data requirements below, writing SQL scripts to create tables, and populating the tables with data.

The Task

Consider the following tables that form part of the DreamHotel database held in a relational DBMS:

Hotel(hotelNo, hotelName, city)
Room(roomNo, hotelNo, type, price)
Booking(bookingNo, guestNo, staffNo, dateFrom, dateTo, roomNo, hotelNo)
Billing(billNo, bookingNo, total)
Guest(guestNo, guestName, guestAddress)
Staff(staffNo, fName, lName, DOB, gender, salary, hotelNo)

1. Initialize the DreamHotel database schema in Workbench.

2. Create Hotel, Room, Booking, Billing, Guest, and Staff tables. Ensure the relevant entity and referntial integrity constraints are enforced.

3. Specify an appropriate general constraint, explain the need for the constraint, and enforce it in the database.

4. Populate the Hotel, Room, and Booking tables with 4 rows each.

5. Delete the following tables and document the process - submit your code and explain what happened when you deleted the tables:

  • Booking
  • Room
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.