中文网站
  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

4.7 Database Systems: Derived Relations

1. SQL-92 allows a subquery expression to be used in the from clause.

2. If such an expression is used, the result relation must be given a name, and the attributes can be renamed.

3. Find the average account balance of those branches where the average account balance is greater than $1,000.

select bname, avg-balance
from (select bname, avg(balance)
from account
group by bname)
as result(bname, avg-balance)
where avg-balance > 1000

Database System Structure: