0% found this document useful (0 votes)
10 views

DataBase Chapter 7

Uploaded by

syedtaqdees8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

DataBase Chapter 7

Uploaded by

syedtaqdees8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

What are the main SQL DDL statements?

The eight base types are: Boolean, character, bit (removed from SQL:2003), exact numeric, approximate
numeric, datetime, interval, large object..

What are the privileges commonly granted to database users?

Common Access Privileges Able to Insert/Update/Delete such as INSERT, UPDATE, DELETE, REMOVE. Able
to do administrative actions such as CREATE USER, CREATE ROLE, ALTER, REPLICATION, DROP
USER/TABLES/SCHEMA's, kill operations, etc.

7.4 Discuss the advantages and disadvantages of views.

Discuss the ways by which a transaction can complete


What restrictions are necessary to ensure that a view is updatable?

What is a materialized view and what are the advantages of a maintaining a materialized view rather
than using the view resolution process?

Describe the difference between discretionary and mandatory access control. What type of control
mechanism does SQL support?
Describe how the access control mechanisms of SQL work

Exercises

Answer the following questions using the relational schema from the Exercises at the end of Chapter 4:

7.10 Create the Hotel table using the integrity enhancement features of SQL.

7.11 Now create the Room, Booking, and Guest tables using the integrity enhancement features of SQL
with the following constraints:

a) type must be one of Single, Double, or Family.


b) price must be between £10 and £100.
c) Room No must be between 1 and 100.
d) Date from and date to must be greater than today’s date.
e) The same room cannot be double-booked.
f) The same guest cannot have overlapping bookings.
Create a separate table with the same structure as the Booking table to hold archive records. Using the
INSERT statement, copy the records from the Booking table to the archive table relating to bookings
before 1 January 2013. Delete all bookings before 1 January 2013 from the Booking table.
Give the users Manager and Director full access to these views, with the privilege to pass the access on
to other users.

Give the user Accounts SELECT access to these views. Now revoke the access from this user

Consider the following view defined on the Hotel schema:

You might also like