Question 1 |

Consider the relational database with the following four schemas and their respective instances.

The number of rows returned by the above SQL query is ___

The number of rows returned by the above SQL query is ___

1 | |

2 | |

4 | |

8 |

Question 1 Explanation:

Question 2 |

Let R_i(z) and W_i(z) denote read and write operations on a data element z by a transaction T_i, respectively. Consider the schedule S with four transactions.

S: R_4(x)R_2(x)R_3(x)R_1(y)W_1(y)W_2 (x)W_3 (y)R_4(y)

Which one of the following serial schedules is conflict equivalent to S?

S: R_4(x)R_2(x)R_3(x)R_1(y)W_1(y)W_2 (x)W_3 (y)R_4(y)

Which one of the following serial schedules is conflict equivalent to S?

T_1\rightarrow T_3\rightarrow T_4\rightarrow T_2 | |

T_1\rightarrow T_4\rightarrow T_3\rightarrow T_2 | |

T_4\rightarrow T_1\rightarrow T_3\rightarrow T_2 | |

T_3\rightarrow T_1\rightarrow T_4\rightarrow T_2 |

Question 2 Explanation:

Question 3 |

Consider a relation R( A, B, C, D, E ) with the following three functional dependencies.

AB \rightarrow C;BC \rightarrow D; C \rightarrow E;

The number of superkeys in the relation R is .

AB \rightarrow C;BC \rightarrow D; C \rightarrow E;

The number of superkeys in the relation R is .

12 | |

8 | |

6 | |

5 |

Question 3 Explanation:

Question 4 |

Consider the following three relations in a relational database.

Employee(eId, Name), Brand (bId, bName), Own(eId ,bId)

Which of the following relational algebra expressions return the set of eIds who own all the brands?

Employee(eId, Name), Brand (bId, bName), Own(eId ,bId)

Which of the following relational algebra expressions return the set of eIds who own all the brands?

**MSQ** \Pi _{eId}(\Pi _{eId,bId}(Own)/\Pi _{bId}(Brand)) | |

\Pi _{eId}(Own)-\Pi _{eId}\left ((\Pi _{eId}(Own) \times \Pi _{bId}(Brand) )-\Pi _{eId,bId}(Own) \right ) | |

\Pi _{eId}(\Pi _{eId,bId}(Own)/\Pi _{bId}(Own)) | |

\Pi _{eId}\left ((\Pi _{eId}(Own) \times \Pi _{bId}(Own) )/\Pi _{bId}(Brand) \right ) |

Question 4 Explanation:

Question 5 |

In a relational data model, which one of the following statements is TRUE?

A relation with only two attributes is always in BCNF. | |

If all attributes of a relation are prime attributes, then the relation is in BCNF. | |

Every relation has at least one non-prime attribute. | |

BCNF decompositions preserve functional dependencies. |

Question 5 Explanation:

Question 6 |

Suppose the following functional dependencies hold on a relation U with attributes P, Q, R, S, \text{ and } T:

P \rightarrow QR \\ RS \rightarrow T

Which of the following functional dependencies can be inferred from the above functional dependencies?

P \rightarrow QR \\ RS \rightarrow T

Which of the following functional dependencies can be inferred from the above functional dependencies?

**[MSQ]**PS \rightarrow T | |

R \rightarrow T | |

P \rightarrow R | |

PS \rightarrow Q |

Question 6 Explanation:

Question 7 |

Let S be the following schedule of operations of three transactions T_1, T_2 \text{ and }T_3 in a relational database system:

R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z)

Consider the statements P and Q below:

P: S is conflict-serializable.

Q: If T_3 commits before T_1 finishes, then S is recoverable.

Which one of the following choices is correct?

R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z)

Consider the statements P and Q below:

P: S is conflict-serializable.

Q: If T_3 commits before T_1 finishes, then S is recoverable.

Which one of the following choices is correct?

Both P and Q are true | |

P is true and Q is false | |

P is false and Q is true | |

Both P and Q are false |

Question 7 Explanation:

Question 8 |

The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department.

\textsf{emp($\underline{\textsf{empId}}$, name, gender, salary, deptId)}

Consider the following SQL query:

\textsf{emp($\underline{\textsf{empId}}$, name, gender, salary, deptId)}

Consider the following SQL query:

```
select deptId, count(*)
from emp
where gender = "female" and salary > (select avg(salary)from emp)
group by deptId;
```

The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary ofemployees in the department | |

employees in the company | |

female employees in the department | |

female employees in the company |

Question 8 Explanation:

Question 9 |

A data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key RollNo. The size of a record pointer for this disk is 7 bytes. Each student-record has a candidate key attribute called ANum of size 12 bytes. Suppose an index file with records consisting of two fields, ANum value and the record pointer the corresponding student record, is built and stored on the same disk. Assume that the records of data file and index file are not split across disk blocks. The number of blocks in the index file is ______

235 | |

248 | |

488 | |

698 |

Question 9 Explanation:

Question 10 |

Consider the following statements S1 and S2 about the relational data model:

S1: A relation scheme can have at most one foreign key.

S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.

Which one of the following choices is correct?

S1: A relation scheme can have at most one foreign key.

S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.

Which one of the following choices is correct?

Both S1 and S2 are true | |

S1 is true and S2 is false | |

S1 is false and S2 is true | |

Both S1 and S2 are false |

Question 10 Explanation:

There are 10 questions to complete.