Database miscellaneous


Database miscellaneous

  1. The maximum number of superkeys for the relation schema R(E, F, G, H) with E as the key is _____.









  1. View Hint View Answer Discuss in Forum

    Maximum no. of super keys = 2n – 1 = 24 – 1 = 23 = 8

    Correct Option: C

    Maximum no. of super keys = 2n – 1 = 24 – 1 = 23 = 8


  1. Given an instance of the STUDENTS relation as shown below :

    For (StudentName, StudentAge) to be a key for this instance, the value X should NOT be equal to _____________ .









  1. View Hint View Answer Discuss in Forum

    Age cannot be 19 as (Student Name, Student Age) is a key.

    Correct Option: A

    Age cannot be 19 as (Student Name, Student Age) is a key.



  1. Which one of the following is not logically equivalent to ̚ ∃x (∀ y (α) ∧ ∀ z (β) ) ?









  1. View Hint View Answer Discuss in Forum

    ∀ ×(∃z(̚β) &rarrr; ∀ y(α)) and ∀ ×(∃y(̚α) &rarrr; ∃z(β)) both are NOT logically equivalent to
    ̚∃ × (∀y(α) ∧ ∀z(β)

    Correct Option: A

    ∀ ×(∃z(̚β) &rarrr; ∀ y(α)) and ∀ ×(∃y(̚α) &rarrr; ∃z(β)) both are NOT logically equivalent to
    ̚∃ × (∀y(α) ∧ ∀z(β)


  1. The employee information in a company is stored in the relation
    Employee (name, sex, salary, deptName)
    Consider the following SQL query :
        Select deptName
          From Employee
          Where sex = ‘M’
          Group by deptName
          Having avg(salary) >
             (select avtg (salary) from Employee)
    It returns the name of the department in which










  1. View Hint View Answer Discuss in Forum

    SQL query will compute as follows
    1. Selects the name from the department
    2. Selects the male employee
    3. Computes that the average salary of male employees is more than the average salary in the company.

    Correct Option: D

    SQL query will compute as follows
    1. Selects the name from the department
    2. Selects the male employee
    3. Computes that the average salary of male employees is more than the average salary in the company.



  1. Let R and S be relational schemas such that R = {a, b, c} and S = {c}. Now consider the following queries on the database:
    1. πR - S - πR - SR - S(r) × S - πr - S , S (r))
    2. { t | t ∈ πR - S(r) ∧ ∀ u ∈ s (∃ v ∈ r ( u = v[s] ∧ t = v[ R - S ] ) ) }
    3. { t | t ∈ πR - S(r) ∧ ∀ u ∈ s (∃ u ∈ s ( u = v[s] ∧ t = v[ R - S ] ) ) }
    4. Select R.a, R. b
    From R, S
    Where R.c = S.c
    Which of the above queries are equivalent?









  1. View Hint View Answer Discuss in Forum

    This is very clear from the options itself that the option 2 and option 4 are equivalent as option 2 is technical representation of code given in option 4. Therefore
    { t | t ∈ πR - S (r) ∈ ∃u ∈ s(∃v ∈ r(u = v[s] ∧ t = v [R - S])) }
    = Select R.a, R.b
    From R, S
    = Where R.c = S.c

    Correct Option: C

    This is very clear from the options itself that the option 2 and option 4 are equivalent as option 2 is technical representation of code given in option 4. Therefore
    { t | t ∈ πR - S (r) ∈ ∃u ∈ s(∃v ∈ r(u = v[s] ∧ t = v [R - S])) }
    = Select R.a, R.b
    From R, S
    = Where R.c = S.c