Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 4 [25 Marks] Referring to Figure 1, write statement to create the Hotel table using the integrity enhancement features of SQL. (8 Marks) Write

The following tables form part of a database held in a relational DBMS: (hotelNo, hotelName, city) (roomNo, 

QUESTION 4 [25 Marks]

  1. Referring to Figure 1, write statement to create the Hotel table using the integrity enhancement features of SQL.

(8 Marks)

  1. Write SQL statement using the Data Defination Language (DDL) or Data Manipulation Language (DML) with the following questions:

  1. Create an INSERT statement to add the tuple of data to the HOTEL table from the following sample data. (7 Marks)

Hotel Number

Hotel Name

City

H001

Sunshine Bay

Tanjung Karang

H002

Mayang Sari

Port Dickson

H003

Corus Jumbo

Air Keroh

H004

Eagle Ranch

Johor Bharu

  1. Change the hotel name of H003 to Classy Jumbo. (2 Marks)
  2. Modify the City of H001 to Kuala Kubu (2 Marks)
  3. Delete Eagle Ranch from HOTEL table (2 Marks)
  1. Create a view containing the hotel name and the names of the guests staying at the hotel.

(2 Marks)

  1. Give the users Manager and Director full access to these views, with the privilege to pass the access on to other users.

The following tables form part of a database held in a relational DBMS:+ (hotelNo, hotelName, city) (roomNo, hotelNo, type, price)+ Hotel Room Booking Guest where Hotel Room forms Booking dateFrom) Guest (hotelNo, guestNo, dateFrom, dateTo, roomNo) < (guestNo, guestName, guestAddress) contains hotel details and hotelNo is the primary key;+ contains room details for each hotel and (roomNo, hotelNo) the primary key; contains details of bookings and (hotelNo, guestNo, forms the primary key; contains guest details and guestNo is the primary key. Figure 1: SCHEMA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

import sqlite3 Connect to the SQLite database create it if it doesnt exist conn sqlite3connecthoteld... 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

L A -r- P[N]

Answered: 1 week ago