Database miscellaneous


Database miscellaneous

  1. Consider a relation geq which represents “greater than or equal to”, that is, (x, y) ∈ geq only if y ≥ x.
    create table geq
    (lb integer not null
    ub integer not null
    primary key lb foreign key (ub) references geq on delete cascade)
    Which of the following is possible if a tuple (x, y) is deleted?









  1. View Hint View Answer Discuss in Forum

    When the tuple (x, y) is deleted, consider the tuple (z, w). Now, in tupel (z, w), z is the lower bound and hence > X. and w is the upper bound and hence > Y.
    → (X, Y) will be easily deleted.
    Therefore, Y > X

    Correct Option: C

    When the tuple (x, y) is deleted, consider the tuple (z, w). Now, in tupel (z, w), z is the lower bound and hence > X. and w is the upper bound and hence > Y.
    → (X, Y) will be easily deleted.
    Therefore, Y > X


  1. Which of the following relational calculus expressions is not safe?









  1. View Hint View Answer Discuss in Forum

    {t | ̚ (t ∈ R)}
    This option contradicts itself. We want a tuple t and t itself is in r1 and we want other tuples than t by using negation so it’s not safe.

    Correct Option: C

    {t | ̚ (t ∈ R)}
    This option contradicts itself. We want a tuple t and t itself is in r1 and we want other tuples than t by using negation so it’s not safe.



  1. Suppose the adjacency relation of vertices in a graph is represented in a table Adj (X, Y). Which of the following queries cannot be expressed by a relational algebra expression of constant length?









  1. View Hint View Answer Discuss in Forum

    (A) ⇒ This is simple select query query.
    (B) ⇒ This is simple query we need to check X=Y in where clause.
    (C) ⇒ Cycle < 3. Means cycle of length 1 & 2. Cycle of length 1 is easy., Same as self loop. Cycle of length 2 is is also not too hard to compute. Though it'll be little complex, will need to do like (X,Y) & (Y, X) both present & X! = Y,. We can do this with constant RA query.
    (D) ⇒ This is most hard part. Here we need to find closure of vertices. This willl need kind of loop. If the graph is like skewed tree, our query must loop for O(N) Times. We can't do with constant length query here.

    Correct Option: D

    (A) ⇒ This is simple select query query.
    (B) ⇒ This is simple query we need to check X=Y in where clause.
    (C) ⇒ Cycle < 3. Means cycle of length 1 & 2. Cycle of length 1 is easy., Same as self loop. Cycle of length 2 is is also not too hard to compute. Though it'll be little complex, will need to do like (X,Y) & (Y, X) both present & X! = Y,. We can do this with constant RA query.
    (D) ⇒ This is most hard part. Here we need to find closure of vertices. This willl need kind of loop. If the graph is like skewed tree, our query must loop for O(N) Times. We can't do with constant length query here.


  1. From the following instance of a relational schema R(A, B, C), we can conclude that










  1. View Hint View Answer Discuss in Forum

    Generally Normalization is done on the schema itself. From the relational instance given,we may strike out FD s that do not hold.
    e.g.B does not functionally determine C(This is true). But we cannot say that A functionally determines B for the entire relation itself.This is because that, A → B holds for this instance,but in future there might be some tuples added to the instance that may violate A → B. So overall on the relation we cannot conclude that A → B,from the relational instance which is just a subset of an entire relation.

    Correct Option: C

    Generally Normalization is done on the schema itself. From the relational instance given,we may strike out FD s that do not hold.
    e.g.B does not functionally determine C(This is true). But we cannot say that A functionally determines B for the entire relation itself.This is because that, A → B holds for this instance,but in future there might be some tuples added to the instance that may violate A → B. So overall on the relation we cannot conclude that A → B,from the relational instance which is just a subset of an entire relation.



  1. With regard to the expressive power of the formal relational query languages, which of the following statements is true?









  1. View Hint View Answer Discuss in Forum

    This is a rule of database theory that relational algebra has same power as safe relational calculus.

    Correct Option: C

    This is a rule of database theory that relational algebra has same power as safe relational calculus.