中文网站
  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.2.3 Database Systems: The from Clause

1. The from class by itself defines a Cartesian product of the relations in the clause.

2. SQL does not have a natural join equivalent. However, natural join can be expressed in terms of a Cartesian product, selection, and projection.

3. For the relational algebra expression

â…¡cname,loan#(borrower ∝ loan)

we can write in SQL,

select distinct cname, borrower.loan#
from borrower, loan
where borrower.loan# = loan.loan#

4. More selections with join: "Find the names and loan numbers of all customers who have a loan at the SFU

branch," we can write in SQL,

select distinct cname, borrower.loan#
from borrower, loan
where borrower.loan# = loan.loan#
and bname="SFU"

Database System Structure: