Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) 1. Write the primary key for


Hotel (hotelNo, hotelName, city)

Room (roomNo, hotelNo, type, price)

Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)

Guest (guestNo, guestName, guestAddress)

1. Write the primary key for the below tables:

Primary Key Constraint for Hotel Table is:

Primary Key Constraint for Room Table is:

Primary Key Constraint for Booking Table is:

Primary Key Constraint for Guest Table is:

2. Write the foreign key for the below tables(If any):

Foreign Key Constraint for Hotel Table is:

Foreign Key Constraint for Room Table is:

Foreign Key Constraint for Booking Table is:

Foreign Key Constraint for Guest Table is:

3. Create Hotel Table with all constraints (for Foreign Key , add ON UPDATE CASCADE ON DELETE CASCADE).

4. Create Room Table with all constraints (for Foreign Key , add ON UPDATE CASCADE ON DELETE CASCADE).

5. Create Booking Table with all constraints (for Foreign Key , add ON UPDATE CASCADE ON DELETE CASCADE).

6. Create Guest Table with all constraints (for Foreign Key , add ON UPDATE CASCADE ON DELETE CASCADE).

7. Create Hotel Table with all constraints (for Foreign Key , add ON UPDATE CASCADE ON DELETE CASCADE).

8. Add unique constraint for Hotel (hotelName)

9. Change the datatype of Hotel(city) to make it Varchar2 (200)

10. Add new column in Hotel Table: Country.

11. Remove Booking Table from the database.

12. What happens if you try to drop Guest Table (that is related with Booking table using Foreign Key constraint)?

 Answer the questions:

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

1 Primary Key Constraints Hotel Table hotelNo Room Table roomNo Booking Table No specified primary key please clarify if there is one Guest Table gues... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach to Design Implementation and Management

Authors: Thomas Connolly, Carolyn Begg

6th Edition Global

132943263, 978-0132943260

More Books

Students also viewed these Databases questions

Question

11.4 What is the basic benefit of using IRR?

Answered: 1 week ago

Question

2. In which brain areas do new neurons form in adultspg109

Answered: 1 week ago

Question

1. Which develops first, a neurons axon or its dendritespg109

Answered: 1 week ago