Revision section 3 Flashcards

1
Q

What do you need to do for:

Write the relational algebra expression for the following query:
SELECT E.NAME, P.NAME
FROM EMPLOYEE E, PROJECT P
WHERE P.PID = E.PID AND E.SALARY > 50000

A

Write the canonical expression

project(select(join))

It doesn’t ask for the most optimal.

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

When creating an optimisation tree, if there are only 2 relations which one goes on the LHS?

A

The PK.

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

What is the IN operator for?

A

It is short hand for OR

ie., ID in (1,2) is ID in 1 or 2

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