Find out how to create a VIEW(external schema) of the database.
Determine some of the limitations of VIEWs.
Remember to run the two commands:
commit;
set autocommit on;
before you do any interactive SQL.
Also remember that the Interactive SQL environment will run whatever is in
the buffer. If you leave a CREATE VIEW statement there ISQL willl re-run it and
give an error. Use the blank option to clear the buffer.
Define a VIEW that will allow the User access to borrower numbers and
names, along with the ISBN, title and reservation date of books currently
reserved.
Invoke the Queries, SQL option.
The VIEW will be based on a SELECT statement so you should concentrate
on getting this right before you actually issue the CREATE VIEW command.
Remember: For 3 tables you will need 2 joins. Have a go at generating
the SELECT statement. Let's face it, you need the practice, that's why
you're doing this trainer:-) Here is one I prepared
earlier.
Once you have a good SELECT statement you can turn it into a CREATE
VIEW statement simply by adding the text CREATE VIEW
borrower_reservations AS in front of your SELECT statement.
Like this.
You can then do a SELECT * FROM borrower_reservations to check
that it worked.
Create a VIEW to restrict Users' access to the BORROWER Table to the
borrower number, name and status only.
Here we are using a VIEW to only present certain data from one table
rather than linking several tables together. i.e. we are performing a
relational PROJECT operation.
This WWW material is copyright De Montfort
University and may only be reproduced or used if this copyright notice is
included.
This page is maintained by John Skelton. Comments or
suggestions for improving this material can be emailed to jas@dmu.ac.uk) and will be gratefully received.