CP363 Lecture Notes - Lecture 10: Tuple, Referential Integrity, Foreign Key
Document Summary
Attributes whose values are to be retrieved. Boolean condition that must be true for any retrieved tuple. Selection conditions include join conditions when multiple relations are involved. Query 1: two tables in from clause (from employee,department) When you have two tables in from clause need a condition to join them. With three table need two join conditions. Same name can be used for two (or more) As long as the attributes are in different relations. Must qualify the attribute name with the relation name to prevent ambiguity. Declare alternative relation names e and s to refer to the employee relation twice in a query. From employee as e,employee as s where e. super_ssn=s. ssn; Recommended to practice abbreviated names and to prefix same or similar attributes from multiple tables. Note that te relation employee now has variable name e. Result is all possible tuple combinations (or the algebra operation of cartesian product)