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

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

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.

An alternate key in database table is also called

Directions (Q96–100): A company is implementing a new database to manage customer information. It holds 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 design aims to improve tracking of sales and customer interactions.

Q2.

Which of the following tables is likely to have a foreign key referencing another table in the database system implemented by the company ?

Q3.

Match List - I with List - II.

Figure

Directions (Q96–100): Relations X(S, Si, C) with tuples (J, 1, M), (B, 2, N), (R, 3, H), (T, 4, G), and Y(S, P, D) with tuples (J, S1, CA), (B, P1, AB), (R, D1, DC), (A, H1, MD).

Q4.

Find the number of tuples obtained by applying the right outer join X ⟖ (X.S = Y.S) Y.

Directions (Q96–100): Relations X(S, Si, C) with tuples (J, 1, M), (B, 2, N), (R, 3, H), (T, 4, G), and Y(S, P, D) with tuples (J, S1, CA), (B, P1, AB), (R, D1, DC), (A, H1, MD).

Q5.

The result of the operation X ⟖ (X.S = Y.S) Y (right outer join) will be:

Directions (Q96–100): Relations X(S, Si, C) with tuples (J, 1, M), (B, 2, N), (R, 3, H), (T, 4, G), and Y(S, P, D) with tuples (J, S1, CA), (B, P1, AB), (R, D1, DC), (A, H1, MD).

Q6.

Which of the following join is used to get all the tuples of relation X and Y with Null values of corresponding missing values?

Directions (Q96–100): Relations X(S, Si, C) with tuples (J, 1, M), (B, 2, N), (R, 3, H), (T, 4, G), and Y(S, P, D) with tuples (J, S1, CA), (B, P1, AB), (R, D1, DC), (A, H1, MD).

Q7.

Number of tuples by applying right outer join on relation X and Y is/are :

Q8.

Given below are the two statements:

Statement I : Any retrieval request that is specified in the basic relational algebra can also be specified in relational calculus.

Statement II : Any retrieval request that is specified in the relational calculus can also be specified in basic relational algebra. In the light of the above statements, choose the correct answer from the options given below:

Q9.

Identify the incorrect statement(s).

Q10.

Consider the two relations below. The primary keys are underlined. Identify all possible foreign key(s) from the options based only on the two Q relations. EMP (eid, ename, did) DEPT (did, dname)

Directions (Q31–35): Sailors S(sid, sname, rating, age): (22, Dustin, 7, 45), (29, Brutus, 1, 33), (31, Lubber, 8, 55.5), (32, Andy, 8, 25.5), (58, Rusty, 10, 35), (64, Horatio, 7, 35), (71, Zorba, 10, 16), (74, Horatio, 9, 35), (85, Art, 3, 25.5), (95, Bob, 3, 63.5). Reserves R(sid, bid, day): (22, 101), (22, 102), (22, 103), (22, 104), (31, 102), (31, 103), (31, 104), (64, 101), (64, 102), (74, 103). Boats B(bid, bname, color): (101, Interlake, blue), (102, Interlake, red), (103, Clipper, green), (104, Marine, red).

Q11.

Which relational algebra query computes the names of sailors who have reserved all boats?

Directions (Q31–35): Sailors S(sid, sname, rating, age): (22, Dustin, 7, 45), (29, Brutus, 1, 33), (31, Lubber, 8, 55.5), (32, Andy, 8, 25.5), (58, Rusty, 10, 35), (64, Horatio, 7, 35), (71, Zorba, 10, 16), (74, Horatio, 9, 35), (85, Art, 3, 25.5), (95, Bob, 3, 63.5). Reserves R(sid, bid, day): (22, 101), (22, 102), (22, 103), (22, 104), (31, 102), (31, 103), (31, 104), (64, 101), (64, 102), (74, 103). Boats B(bid, bname, color): (101, Interlake, blue), (102, Interlake, red), (103, Clipper, green), (104, Marine, red).

Q12.

Which relational algebra query computes the names of sailors who have reserved a red and a green boat?

Q13.

Given a fixed‐length record file that is ordered B on the key field. The file needs disk blocks to R store number of records. Find the average access time needed to access any record of the given file using binary search.

Q14.

Given the following STUDENT‐COURSE scheme: STUDENT (Rollno, Name, courseno) COURSE (courseno, coursename, capacity), where Rollno is the primary key of relation STUDENT and courseno is the primary key of relation COURSE. Attribute coursename of COURSE takes unique values only. Which of the following query(ies) will find total number of students enrolled in each course, along with its coursename. *

A. SELECT coursename, count( ) 'total' from STUDENT natural join COURSE group by

coursename;
*

B. SELECT C.coursename, count( ) 'total' from STUDENT S, COURSE C where

S.courseno=C.courseno group by coursename;
*

C. SELECT coursename, count( ) 'total' from COURSE C where courseno in (SELECT courseno

from STUDENT);
Q15.

Given STUDENT(Rollno, Name, Courseno) and COURSE(Courseno, Coursename, Capacity) with 5 and 3 records, R = STUDENT × COURSE is computed. Match List I with List II. List I: A. Degree of table R, B. Cardinality of table R, C. Foreign key of relation STUDENT, D. Foreign key of relation COURSE. List II: I. 15, II. NIL, III. 6, IV. Courseno.

Q16.

Consider a relational schema S = (U, V , W, X, Y , Z) on which the following functional dependencies hold: {U → V , V W → X, Y → W, X → U} Which are the candidate keys among following options?

Q17.

Given two tables R1(x,y) and R2(y,z) with 50 and 30 numbers of tuples respectively. Find the maximum number of tuples in the output of natural join between tables R1 and R2 i.e. R1 * R2. (* - Natural Join)

Directions (Q96–100): An organization maintains a database with five attributes A, B, C, D, E. Consider the universal relation R(A, B, C, D, E) with functional dependency set F = {A → BC, D → E, BC → D, A → D}. All attributes are simple and atomic.

Q18.

Identify primary key of table with F functional dependency set

Q19.

Which of the following has same expressive power with regard to relational query language?

(a) Relational algebra and domain relational calculus

(b) Relational algebra and tuples relational calculus

(c) Relational algebra and domain relational calculus restricted to safe expression

(d) Relational algebra and tuples relational calculus restricted to safe expression

Q20.

With respect to relational algebra, which of the following operations are included for mathematical set theory?

(a) Join

(b) Intersection

(c) Cartisian product

(d) Project

Q21.

Which of the following key constraints is required for functioning of foreign key in the context of relational databases?

Q22.

In relational database management, which of the following is/are property/properties of candidate key? P : Uniqueness Q : Irreducibility

Q23.

A table has attributes Employee_id (primary key) and Manager_id (foreign key referencing Employee_id with ON DELETE CASCADE), with tuples (20, 40), (25, 40), (30, 35), (35, 20), (40, 45), (45, 25). On deleting the tuple (20, 40), which other tuples must be deleted to maintain referential integrity?

Q24.

Consider a relation schema R = (A, B, C, D, E, F) on which the following functional dependencies hold :

A → B B, C → D

E → C

D → A What are the candidate keys of R?

Q25.

In RDBMS, which type of Join returns all rows that satisfy the join condition ?

Q26.

A many-to-one relationship exists from entity set r₁ to entity set r₂. If Pk(r) denotes the primary key of relation r, how is it represented using functional dependencies?

Q27.

Let R₁(a, b, c) and R₂(x, y, z) be relations in which a is a foreign key of R₁ referring to the primary key of R₂. Consider: (a) insert into R₁, (b) insert into R₂, (c) delete from R₁, (d) delete from R₂. Which is correct about the referential integrity constraint?