edited by
3,369 views
13 votes
13 votes

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 involved in which projects. The underlined attributes are the primary keys for the respective relations. 

State in English (in not more than 15 words) 

What the following relational algebra expressions are designed to determine 

  1. $\Pi_{eno}(\text{INVOLVED}) - \Pi_{eno} ((\Pi_{eno}(\text{INVOLVED}) \times \Pi_{pno}(\text{PROJ}))-\text{INVOLVED})$

  2. $\Pi_{age}(\text{EMP})-\Pi_{age} (\sigma _{ E.age<Emp.age}( (\rho E(\text{EMP}) \times \text{EMP})) $

(Note: $\rho E(\text{EMP}) $ conceptually makes a copy of $\text{EMP}$ and names it $E$ ($\rho$ is called the rename operator))

edited by

1 Answer

Best answer
16 votes
16 votes
  1.  $\Pi_{eno}(INVOLVED)$$-\Pi_{eno}((\Pi_{eno}(INVOLVED)\times \Pi_{pno}(PROJ)−INVOLVED)$

    • $\Pi_{eno}(INVOLVED)-$ All employees involved in projects $\quad \to (A)$
    • $\Pi_{eno}((\Pi_{eno}(INVOLVED)\times \Pi_{pno}(PROJ)−INVOLVED)-$ gives all employee who are not involved in at least one project. $\quad \to (B)$
    • $A-B =$ employee No. of employees involved on the all project. (Division Operator)

  1.  $\Pi_{age}(EMP)−\Pi_{age}(σ_{Eage<EMP.age}(ρE(EMP)\times EMP))$

    • $\Pi_{age}(EMP)-$ Age of all employees $\quad \to (C)$
    • $\Pi_{age}(σ_{Eage<EMP.age}(ρE(EMP)\times EMP)) -$ Employees who have age less than at least one other employee $\quad \to (D)$
    • $C- D =$ Maximum of all ages of employees.
edited by

Related questions

6.5k
views
3 answers
12 votes
go_editor asked Oct 15, 2015
6,470 views
Consider the following relational database schema:EMP (eno name, age)PROJ (pno name)INVOLVED (eno, pno)EMP contains information about employees. PROJ about projects ... eno from EMP|INVOLVED where EMP.eno=INVOLVED.eno and INVOLVED.pno=3
15.4k
views
5 answers
42 votes
Kathleen asked Sep 29, 2014
15,371 views
A $B^+$ - tree of order $d$ is a tree in which each internal node has between $d$ and $2 d$ key values. An internal node with $M$ key values has $M + 1$ children. ... number of leaves in a $B^+$-tree of order $d$ and height $h(h\geq 1)$?
12.1k
views
2 answers
30 votes
Kathleen asked Sep 29, 2014
12,123 views
For a database relation $R(a, b, c, d)$, where the domains $a, b, c, d$ include only atomic values, only the following functional dependencies ... formin second normal form but not in first normal formin third normal formnone of the above
7.9k
views
4 answers
42 votes
go_editor asked Oct 14, 2015
7,918 views
An operating system handles requests to resources as follows.A process (which asks for some resources, uses them for some time and then exits the system) is assigned a ... Can a process P ever starve? If yes, show how. If not prove it.