CREATE VIEW Statements

Because views are based on tables, there are no problems with datatypes or NULL status. The only adjustment you may need to make involves column headings, if they happen to include characters illegal on your system. (You may also need to modify view names if they are used by some other object in the RDBMS.) Be sure to change the terminator (;) for systems that require a different symbol.

 drop view titleview; create view titleview as select title, au_ord, au_lname, price, ytd_sales, pub_id from authors, titles, titleauthors where authors.au_id = titleauthors.au_id and titles.title_id = titleauthors.title_id ; drop view oaklanders; create view oaklanders (FirstName, LastName, Book) as select au_fname, au_lname, title from ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.