中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

3.7.1 Database Systems: View Definition

1. A view is defined using the create view command:

create view v as <query expression>
where <query expression> is any legal query expression. The view created is given the name v.

2. To create a view all_customer of all branches and their customers:

create view all_customer as

â…¡bname,cname(deposit) ∪â…¡bname,cname(borrow)

3. Having defined a view, we can now use it to refer to the virtual relation it creates. View names can appear anywhere a relation name can.

4. We can now find all customers of the SFU branch by writing

â…¡cname(∑bname="SFU"(all customer))

Database System Structure: