• edited by
6,559 views
20 20 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))

    2 Answers

    Best answer
    25 25 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
    3 3 votes

    1.

    SET of all those ' eno' whos pair with every ' pno ' of PROJ in INVOLVED (table).

    INVOLVED (eno, pno) ÷ PROJ (pno)

    2.

    Maximum of all ages of employees  or  Minimum of all ages of employees. depending on which age we select

     

    Position:
    Show:

    Related questions

    20 20 votes
    5 answers 5 answers
    12.2k
    12.2k views
    go_editor asked Oct 15, 2015
    12,207 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 and i...
    2 2 votes
    3 3 answers
    2.9k
    2.9k views
    soujanyareddy13 asked May 12, 2021
    2,899 views
    Given two tablesEMPLOYEE (EID, ENAME, DEPTNO) DEPARTMENT (DEPTNO, DEPTNAME)Find the most appropriate statement of the given query:Select count (*) ‘total’ from EMPLOYEE w...
    3 3 votes
    2 answers 2 answers
    2.3k
    2.3k views
    Bikram asked Nov 26, 2016
    2,281 views
    This is an Instance of Sailors Relation$$\overset{\text{Sailors Table}} { \begin{array}{|l|l|} \hline \text{S_ID} & \text{S_Name} & \text{Rating} & \text{Age} \\ \hline 1...
    1 1 vote
    1 answers 1 answer
    1.1k
    1.1k views
    Bikram asked Nov 26, 2016
    1,123 views
    Let $R = (A,B,C)$, and let $r1$ and $r2$ both be relations on schema $R$. Select a SQL expression among these options that is equivalent to the following query. $ \Pi AB(...