Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how i do this at my sql in data base and how I will solve the questions down College of Computer Science CIS 321: Database

how i do this at my sql in data base and how I will solve the questions down image text in transcribed
image text in transcribed
image text in transcribed
College of Computer Science CIS 321: Database Concepts & Design Department of Computer information System Header I Lab 3: DDL in MySQL Workbench In-class Exercise Submission instructions: Use this template Name the file: group_studentId firstName sumams Save your file as PDF Use your knowledge of DDL in MySal 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 for updated) from the parent table a. Hotel Table Table hotel Columns het bRoom Table INC Tables room Columns roomto X hotelNoint 11) PK type Vardar (45) price decimal(10,0) c. Guest Table: Table: guest Columns Questo (11) prestame www(45) guestAddress text For 1 College of Computer Science CIS 321: Database Concepts & Design Department of Computer Information System d Booking Table Tableshooting Columns hotello questo int datefrom date datelo rondo ENG Navigation Position Answer: 3. Add a referential integrity constraint (FK constraints) on the attribute roomNo from booking table to refer to the attribute "room No' in room table. 4. Add a new column to the guest table to represent the guest's gender. Name the column 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 nor work with ASOL 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. 8Populate your tables with & records at least in every rate. Include the INSERT statements and screenshots of the finul tables after insertions Night

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

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

=+2 Why did OBI create Centers of Excellence?

Answered: 1 week ago