example of cartesian product query
SELECT c.clientNo, c.fname, c.lname, v.clientNo, v.propertyNo, v.viewDate, v.comment
FROM client c, viewing
What are multi-table queries?
Eg of three table join
SELECT b.branchNo, b.city, s.staffNo, fName, lName, propertyNo
FROM branch b, staff s, propertyForRent
WHERE b.branchNo = s.branchNo AND
s.staffNo = p.staffNo
ORDER BY b.branchNo, s.staffNo, propertyNo;
list the procedures for generating results of a join
What are outer joins?
outer join operations retain rows that do not satisfy the join condition
What are left outer joins?
includes rows of first (left) table unmatched with rows from second right table
columns from second table are filled nulls
What are right outer joins?
What are full outer joins?
* unmatched columns are filled with nulls
ANY and ALL
Exists and Not exists
EXISTS and NOT EXISTS are for use only with subqueries
Produce a simple true/false result
True if and only if there exists at least one row in result table returned by subquery
False if subquery returns an empty result table
NOT EXISTS is the opposite of EXISTS
List the relational algebra
theta join equijoin natural join outer join left outer join
also division command