quick refrehers Flashcards

1
Q

what happens when join condition is ommited in sql

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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%”
A

hnkj

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

R - S ( except ) is NOT EQUAL S - R

A

Rember this

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

R1 divided by R2

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly