Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use your knowledge of DDL in MySq 1 Workbench to answer the following: ( answers should be working SQL statements 1 - Create a new

Use your knowledge of DDL in MySq1 Workbench to answer the following: (answers should be working SQL statements
1- Create a new database named hotels.
2- Create the tables Hotel, Room, Booking and Guest with the following columns Declare the corresponding primary and foreign keys: corresponding rows are deleted (or updated) from the referencing table if that row is deleted (or updated) from the arent table. a. Hotel
a. Hotel Table:
b. Room Table:
c. Guest Table:
d. Booking Table:
3- Add a referential integrity constraint (FK constraints) on the attribute 'roomNo' from booking table to refer to the attribute 'roomNo' in room table.
Lab instructors: Dr. Mona Alghamdi & L. Sameerah Albalhareth4- Add a new column to the guest table to represent the guest's gender. Name the column 'gender' of type char(1). 'gender' of type char(1)5- Add a constraint to column 'gender' in the guest table to limit the possible values to F or M.(note: CHECK might not work with MySQL Workbench, can you think of a way to make it work?)6- Modify the column 'type' in the room table to have a default value of "single".7- Delete the column 'price' from the room table.8- Populate your tables with 8 records at least in every table. Include the INSERT statements and screenshots of the final tables after insertions.Lab instructors: Dr. Mona Alghamdi & L. Sameerah AlbalharethCIS 321: Database Concepts & Design
\table[[,guest,roomNo,hotelNo,dateTo,dateFrom],[b,1,943,1,2021-02-08,2021-02-14],[2,712,2,2021-01-28,2021-02-15],[3,426,3,2021-02-01,2021-03-05],[4,293,6,2021-01-26,2021-02-01],[5,383,2,2021-01-27,2021-01-29
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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 Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions