All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 04 · MOCK TEST

Mock 2 – Relational Model, Algebra & Calculus (Part 1)

Unit 4: Database Management Systems · 27 questions · about 32 minutes. Press End Mock any time to see your score and the correct answers.

All 11 topic-wise mocks in this unit
0 / 27 answered 00:00
Q1. A safe expression in relational calculus is one that is guaranteed to yield
Q2. Which of the following are true?
A. A database may have only one primary key
B. Every key is a candidate key
C. There can be multiple candidate keys
D. There can be more than one super keys
E. Every candidate key is a primary key.
Choose the correct answer from the options given below:
Q3. Consider the following three relations: Employee(eid, eName), Comp(cid, cName), Own(eid, cid). Which of the following relational algebra expressions returns the set of eids who own all brands?
Q4. Consider R(A, B, C, D, E) be a relation with the following dependencies: C → F, E → A, EC → D, A → B. Which of the following is a key for R?
Q5. An alternate key in a database table is also called
Q6. Consider a relation schema R = (U, V, W, X, Y, Z), on which the following functional dependencies hold: {U → V, VW → X, Y → W, X → U}. The candidate keys of R are:
Q7. How does a relational database ensure data integrity?
Q8. Match List I with List II
List IList II
(a) BCNF iff(I) every JD is implied by the candidate keys
(b) 5NF iff(II) all underlying domains contain scalar values only
(c) 1NF iff(III) every MVD is implied by the candidate keys
(d) 4NF iff(IV) every FD is implied by the candidate keys

Directions (Q96–100): Consider the relations X(S, Si, C) and Y(S, P, D):

X
SSiC
J1M
B2N
R3H
T4G
Y
SPD
JS1CA
BP1AB
RD1DC
AH1MD
Q9. Find the number of tuples obtained by applying the operation X ⟕X.S = Y.S Y (left outer join).

Directions (Q96–100): Consider the relations X(S, Si, C) and Y(S, P, D):

X
SSiC
J1M
B2N
R3H
T4G
Y
SPD
JS1CA
BP1AB
RD1DC
AH1MD
Q10. The result of the operation X ⟖X.S = Y.S Y (right outer join) will be:

Directions (Q96–100): Consider the relations X(S, Si, C) and Y(S, P, D):

X
SSiC
J1M
B2N
R3H
T4G
Y
SPD
JS1CA
BP1AB
RD1DC
AH1MD
Q11. Which join is used to get all the tuples of relations X and Y, with NULL values for the corresponding missing values?

Directions (Q96–100): Consider the relations X(S, Si, C) and Y(S, P, D):

X
SSiC
J1M
B2N
R3H
T4G
Y
SPD
JS1CA
BP1AB
RD1DC
AH1MD
Q12. The number of tuples obtained by applying a right outer join on relations X and Y is:

Directions (Q96–100): Consider the relations X(S, Si, C) and Y(S, P, D):

X
SSiC
J1M
B2N
R3H
T4G
Y
SPD
JS1CA
BP1AB
RD1DC
AH1MD
Q13. The number of tuples obtained by applying the Cartesian product over X and Y is:

Directions (Q96–100): A company is implementing a new database system to manage its customer information. The database contains tables for customers, orders, products and sales representatives. Each customer can place multiple orders and each order can contain multiple products. Each order is associated with a specific sales representative who manages the account. The database is designed to improve efficiency in tracking sales and customer interactions.

Q14. Which of the following tables is most likely to have a foreign key referencing another table?
Q15. A ______ operation combines the rows of two relations and outputs a new relation that has both input relations' rows in it.
Q16. Consider the relation R(P, Q, R, S, T, U, V, W, X, Y) and FDs: {P, Q, S} → T, R → Y, {P, Q} → V, {R, X} → X, Q → U, V → {W, X}. Which of the following is a candidate key?
Q17. Statement I: Any retrieval request that can be specified in basic relational algebra can also be specified in relational calculus.
Statement II: Any retrieval request that can be specified in relational calculus can also be specified in basic relational algebra.

Directions (Q96–100): Use the following schema of an academic institution's relational database:

student (rollno, name, degree, year, sex, deptno, advisor)
department (deptid, name, hod, phone)
professor (empid, name, sex, startyear, deptno, phone)
course (courseid, cname, credits, deptno)
enrollment (rollno, courseid, sem, year, grade)
teaching (empid, courseid, sem, year, classroom)
prerequisite (precourseid, courseid)

deptno in student, professor and course refers to department.deptid; advisor (student) and hod (department) refer to professor.empid; rollno in enrollment refers to student; courseid in enrollment and teaching refers to course; empid in teaching refers to professor; precourseid and courseid in prerequisite refer to course.

Q18. Which of the following queries would retrieve the roll numbers and names of students who have enrolled in ALL the prerequisite courses of course number 324?
Q19. Identify the incorrect statement.
Q20. Consider the two relations below (primary keys: EMP.eid and DEPT.did). Identify all possible foreign key(s) based only on the two relations.
EMP (eid, ename, did)
DEPT (did, dname)

Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.

Table 1: Sailors

SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5

Table 2: Reserves

SidBidDay
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98

Table 3: Boats

BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Q21. Which relational algebra query computes the sids of sailors with age over 20 who have not reserved a red boat?

Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.

Table 1: Sailors

SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5

Table 2: Reserves

SidBidDay
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98

Table 3: Boats

BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Q22. Which query/queries compute the names of sailors who have reserved a red boat?
Q1: πsname((σcolor='red' Boats) ⋈ Reserves ⋈ Sailors)
Q2: πsname(πsid((πbid σcolor='red' Boats) ⋈ Reserves) ⋈ Sailors)
Q3: πsname((σcolor='red' Reserves) ⋈ Boats ⋈ Sailors)

Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.

Table 1: Sailors

SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5

Table 2: Reserves

SidBidDay
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98

Table 3: Boats

BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Q23. Which query/queries compute the names of sailors who have reserved boat 103?
Q1: πsname((σbid=103 Boats) ⋈ Sailors)
Q2: πsname(σbid=103(Reserves ⋈ Sailors))
Q3: πsname((σbid=103 Reserves) ⋈ Sailors)

Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.

Table 1: Sailors

SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5

Table 2: Reserves

SidBidDay
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98

Table 3: Boats

BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Q24. Which query computes the names of sailors who have reserved all boats?

Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.

Table 1: Sailors

SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5

Table 2: Reserves

SidBidDay
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98

Table 3: Boats

BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Q25. Which query computes the names of sailors who have reserved a red and a green boat?
Q26.

Consider the following three relations Employee(eid, eName), Comp(cid, cName), Own(eid, cid). Which of the following relational algebra expressions returns the set of eids who own all brands?

Q27.

Consider R(A, B, C, D, E) be relation with following dependencies: C->F, E->A, EC->D, A->B. Which of the following is a key for R ?