Content

  1. Tips

Tips

  • May not drop table with referential constraints
    • Drop something in source OK; problem dropping in referenced table
    • Add something in referenced table OK; problem dropping in source
  • Foreign keys must reference primary key or other superkeys of the referenced table
  • UNION and OR are not interchangeable; UNION will discard duplicates

    • OR
        SELECT E.name
        FROM Employees E, Works_in W
        WHERE E.employee_id= W.employee_id
        AND(W.department_id = 1 OR W.department_id = 3)
      
    • OR

        SELECT E.name
        FROM Employees E, Works_in W
        WHERE E.employee_id = W.employee_id 
        AND W.department_id = 1
      
        UNION
      
        SELECT E.name
        FROM Employees E, Works_in W
        WHERE E.employee_id = W.employee_id 
        AND W.department_id = 3
      
  • INTERSECT = JOIN, EXCEPT = NOT IN
  • UNKNOWN is like 0.5 in comparisons
  • Assertions are checked every time the table is updated

results matching ""

    No results matching ""