SQLJoin

Summary of SQL Join Syntax

  1. Cross Join

    • the result is Cartesian product or simply product

    • e.g., Movie CROSS JOIN StarsIn

  2. Theta Join

    • Product on some conditions

    • e.g., Movie JOIN StarsIn ON title = movieTitle AND year = movieYear

    • default is LEFT INNER JOIN

  3. Natural Join

    • the condition in theta join is just all pairs of attributes with same name

    • one of each pair of same name is projected out

    • e.g., MovieStar NATURAL JOIN MovieExec

  4. Outer Join

    • augment the result of a join by the dangling tuples, padded with null values

    • e.g., MovieStar NATURAL FULL OUTER JOIN MovieExec

    1. FULL OUTER JOIN

    2. LEFT OUTER JOIN

    3. RIGHT OUTER JOIN

  5. Semi Join

  6. References

last edited 2007-11-24 12:06:50 by YoonKyungKoo