quick refrehers Flashcards
what happens when join condition is ommited in sql
Cartesian product
SELECT FNAME, SSN
FROM EMPLOYEE, DEPARTMENT
WHERE DNAME=‘Research’ ( And Dno = Dnumber is ommited);
→ CARTESIAN PRODUCT (between subset of DEPARTMENT and everything of EMPLOYEE)
which can result in very large relations
EXISTS → checks if the inner query contains tuples (isn’t empty)
NOT EXISTS does the opposite
- Example :
SELECT *
FROM EMPLOYEE
WHERE EXISTS (SELECT *
FROM DEPARTMENT
WHERE Dno=Dnumber AND MgrStartDate LIKE “198%”
hnkj
R - S ( except ) is NOT EQUAL S - R
Rember this
R1 divided by R2
R2 is a subset of R1
every attribute in r2 is in r1
and r2 is not equal to r1
The division results in tuples which appear in R in combination with
EVERY tuples in S
Identified usually by All and Every in the natural language sentence