Consider the following relational database schema: EMP (eno, name, age) PROJ…

PYQ GATE 1997

Consider the following relational database schema:

EMP (eno, name, age)

PROJ (pno, name)

INVOLVED (eno, pno)

EMP contains information about employees, PROJ about projects, and INVOLVED about which employees are involved in which projects. The underlined attributes are the primary keys of the respective relations.

(a) Give a relational algebra expression using one or more of {σ, π, ×, ρ, −} equivalent to the following SQL query:

SELECT EMP.eno
FROM EMP, INVOLVED
WHERE EMP.eno = INVOLVED.eno
  AND INVOLVED.pno = 3

(b) State in English, using no more than 15 words for each, what the following relational algebra expressions determine:

(i) π_eno(INVOLVED) − π_eno((π_eno(INVOLVED) × π_pno(PROJ)) − INVOLVED)
(ii) π_age(EMP) − π_E.age(σ_E.age<EMP.age(ρ_E(EMP) × EMP))

Note: ρ_E(EMP) makes a copy of EMP named E; ρ is the rename operator.

Attempted by 1 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…