Division Operator MCQs: 10 Solved Questions with Explanations

Solve ten published Division Operator MCQs, then use the worked missing-pair method to diagnose errors in universal queries, schemas, and cardinality.

KnowledgeGate Team

Exam prep & CS education

Updated 29 Aug 20268 min read

Division handles relational algebra “for every” queries, but distractors change “every” to “at least one”, reverse the operands, or drop an attribute. Universal-condition questions turn on operand order and the attributes retained before division. Solve each one before reading its explanation, then use the linked practice set for another attempt. Start from the GATE CS Exam Preparation category.

Division in relational algebra: one worked example

If R(X,Y) and S(Y) are compatible on Y, R ÷ S returns each X paired with every Y in S. Translate “all” into a missing-pair test, not a join.

Let Enroll(Student,Course) = {(A,DBMS), (A,OS), (B,DBMS), (B,OS), (C,DBMS)} and Required(Course) = {(DBMS), (OS)}. Thus Enroll ÷ Required = {(A), (B)} because C lacks OS.

The basic-operator identity confirms it:

  1. Candidates = πStudent(Enroll) = {A,B,C}.

  2. Candidates × Required contains six required pairs.

  3. (Candidates × Required) - Enroll = {(C,OS)}.

  4. Projecting Student from the missing pairs gives {C}.

  5. {A,B,C} - {C} = {A,B}.

An ordinary join only finds existing pairs. Compare it with division in the SQL queries and joins in DBMS refresher.

Questions 1-3: recognise the “for every” query shape

Question 1

Division operation is ideally suited to handle queries of the type :

  • A. customers who have no account in any of the branches in Delhi.

  • B. customers who have an account at all branches in Delhi.

  • C. customers who have an account in atleast one branch in Delhi.

  • D. customers who have only joint account in any one branch in Delhi

Answer: B. customers who have an account at all branches in Delhi.

For Accounts = {(A,D1),(A,D2),(B,D1)} and DelhiBranches = {(D1),(D2)}, division returns {A}, which covers every branch. Option A needs difference or an anti-join; C is existential. Exam source: UGC NET 2014 Computer Science, Paper 2 (December). Open the solved question.

Question 2

Consider the following schema : Sailors (sid, sname, rating, age)

Boats (bid, bname, colour)

Reserves (sid, bid, day) Two boats can have the same name but the colour differentiates them. The two relations ρ (Tempsids, (Ⲡ sid, bid Reserves)/(Ⲡ bid ( σ bname ='Ganga' Boats))),

Ⲡ sname (Tempsids ⋈ Sailors) If / is division operation, the above set of relations represents the query

  • A. Names of sailors who have reserved all boats called Ganga

  • B. Names of sailors who have not reserved any Gangaboat

  • C. Names of sailors who have reserved at least one Gangaboat

  • D. Names of sailors who have reserved at most one Ganga boat

Answer: A. Names of sailors who have reserved all boats called Ganga.

The numerator keeps (sid,bid) reservations; the divisor holds every Ganga bid. Division returns sailors related to every such ID, then the join returns their names. Exam source: Indian Space Research Organization 2017 Computer Science, December. Open the solved question.

Question 3

Employee (eid, eName), Comp(cid, cName), Own(eid, cid). Which of the following relational algebra expression return the set of eids who own all brands:

(1) πeid​(πeid,cid​(Own)/πcid​(Comp))

(2) πeid​(πeid​(Own)×πcid​(Comp))

(3) πeid​(πeid,cid​(Own)×πcid​(Comp))

(4) πeid​(πeid​(Own)×(πcid,cName​(Own)/πcid​(Comp)))

  • A. 1

  • B. 2

  • C. 3

  • D. 4

Answer: A. 1.

Expression 1 divides Own(eid,cid) by πcid(Comp), returning eids paired with every company ID. Expressions 2 and 3 form products; expression 4 wrongly projects cName from Own. Exam source: UGC NET 2025 Computer Science, Paper 2 (June). Open the solved question.

Questions 4-6: build and interpret universal expressions

Question 4

Read the following data and answer the question.

Consider the relational schema of Sailors S, Reserves R, and Boats B.

Table 1: Sailors S

sid

sname

rating

age

22

Dustin

7

45.0

29

Brutus

1

33.0

31

Lubber

8

55.5

32

Andy

8

25.5

58

Rusty

10

35.0

64

Horatio

7

35.0

71

Zorba

10

16.0

74

Horatio

9

35.0

85

Art

3

25.5

95

Bob

3

63.5

Table 2: Reserves R

sid

bid

day

22

101

10/10/98

22

102

10/10/98

22

103

10/8/98

22

104

10/7/98

31

102

11/10/98

31

103

11/6/98

31

104

11/12/98

64

101

9/5/98

64

102

9/8/98

74

103

9/8/98

Table 3: Boats B

bid

bname

color

101

Interlake

blue

102

Interlake

red

103

Clipper

green

104

Marine

red

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

  • A. 𝜌 (Tempsids, ( 𝜋 bid Reserves) / 𝜋 bid Boats) 𝜋 sname ((Tempsids) ⋈ Sailors)

  • B. 𝜌 (Tempsids, ( 𝜋 sid, bid Reserves) / 𝜋 bid Boats) 𝜋 sname ((Tempsids) ⋈ Sailors)

  • C. 𝜌 (Tempsids. ( 𝜋 sid Sailors) / 𝜋 bid Boats) 𝜋sname ((Tempsids)  Sailors)

  • D. 𝜌 (Tempsids, ( 𝜋 sid Reserves) /𝜋 bid Boats) 𝜋 sname ((Tempsids) ⋈ Boats)

Answer: B.

Divide πsid,bid(Reserves) by πbid(Boats). Sailor 22 has 101-104, so the result is Dustin. Sailor 31 lacks 101, sailor 64 lacks 103 and 104, and sailor 74 has only 103. Exam source: UGC NET 2022 Computer Science, Paper 2 (June). Open the solved question.

Question 5

Information about a collection of students is given by the relation studinfo(studId, name, sex). The relation enroll(studId, courseId) gives which student has enrolled for (or taken) that course(s). Assume that every course is taken by at least one male and at least one female student. What does the following relational algebra expression represent?

Relational algebra expression that returns courses in which only a proper subset of the female students are enrolled.
  • A. Courses in which all the female students are enrolled.

  • B. Courses in which a proper subset of female students are enrolled.

  • C. Courses in which only male students are enrolled.

  • D. None of the above

Answer: B. Courses in which a proper subset of female students are enrolled.

The image is πcourseId((πstudId(σsex="female"(studInfo)) × πcourseId(enroll)) - enroll). The product creates every female-course pair. Subtraction leaves missing enrolments; projection finds courses missing at least one female. Since each course has an enrolled female, its enrolled set is a proper subset. Exam source: GATE 2007 Computer Science. Open the solved question.

Question 6

Consider a database that includes the following relations:

    Defender(name, rating, side, goals)

    Forward(name, rating, assists, goals)

    Team(name, club, price)

Which ONE of the following relational algebra expressions checks that every name occurring in Team appears in either Defender or Forward, where 𝜙 denotes the empty set?

  • A. Π𝑛𝑎𝑚𝑒 (Team) \ (Π𝑛𝑎𝑚𝑒 (Defender)∩ Π𝑛𝑎𝑚𝑒 (Forward)) = 𝜙

  • B. (Π𝑛𝑎𝑚𝑒 (Defender)∩ Π𝑛𝑎𝑚𝑒 (Forward)) \ Π𝑛𝑎𝑚𝑒 (Team) = 𝜙

  • C. Π𝑛𝑎𝑚𝑒 (Team) \ (Π𝑛𝑎𝑚𝑒 (Defender)∪ Π𝑛𝑎𝑚𝑒 (Forward)) = 𝜙

  • D. (Π𝑛𝑎𝑚𝑒 (Defender)∪ Π𝑛𝑎𝑚𝑒 (Forward)) \ Π𝑛𝑎𝑚𝑒 (Team) = 𝜙

Answer: C.

The condition is TeamNames ⊆ DefenderNames ∪ ForwardNames, so TeamNames - (DefenderNames ∪ ForwardNames) must be empty. Difference and union still test that nothing required is missing. Exam source: GATE 2024 Data Analytics. Open the solved question.

Questions 7-9: calculate results and cardinality bounds

Question 7

Consider the following relation schema R and S along with their tuple sets.

R(A, B) = {<a1, b1>, <a2, b1>, <a3, b1>, <a4, b1>, <a1, b2>, <a3, b2>, <a2, b3>, <a3, b3>, <a4, b3>, <a1, b4>, <a2, b4>, <a3, b4>}

S(A) = {a1, a2, a3}

What is the value of T ← R / S, where “/” represents the Relational Algebra “division” operation?

  • A. T(B) = {b1, b3}

  • B. T(B) = {b1, b2, b4}

  • C. T(B) = {b1, b4}

  • D. T(B) = {b1, b3, b4}

Answer: C. T(B) = {b1, b4}.

Against {a1,a2,a3}, b1 and b4 qualify; b2 lacks a2 and b3 lacks a1. Extra tuple <a4,b1> is harmless because every required A is present. Exam source: Coal India 2017 Computer Science. Open the solved question.

Question 8

Suppose that cardinalities of relations A and B are m and n respectively, then the maximum cardinality of the resultant relation A ÷ B is (A divides B)

  • A. m

  • B. m-n

  • C. ⌈m/n⌉

  • D. ⌊m/n⌋

Answer: D. ⌊m/n⌋.

For non-empty B, each output needs n numerator tuples. For m=11,n=3, three groups use nine; two leftovers cannot form a fourth, so ⌊11/3⌋ = 3. Try more Division Operator questions in the practice set.

Question 9

When R, S has no common attributes then value of ((R⋈S)÷S)) is always equal to

  • A. S

  • B. R x S

  • C. R ⋈ S

  • D. None

Answer: D. None.

With no common attributes, R ⋈ S = R × S. Let non-empty R={1,2} and S={x,y}. The join is {(1,x),(1,y),(2,x),(2,y)}; division by S returns R. R is absent from the options, so D is correct. Try more Division Operator questions in the practice set.

Question 10: separate join cardinality from division cardinality

Question 10

Consider the join of a relation R , with a relation S . If R has m number of tuples and S has n number of tuples then the maximum and minimum sizes of the join respectively are:

  • A. m + n & 0

  • B. mn & 0

  • C. m + n & | m - n |

  • D. mn & m + n

Answer: B. mn & 0.

Without constraints, every pair or none can match. If all tuples share one join-key value and m=3,n=4, the join reaches 3×4=12; disjoint values {1,2,3} and {4,5,6,7} give zero. Unlike Question 8, join counts matching pairs. Exam source: Indian Space Research Organization 2016 Computer Science. Open the solved question.

A five-line solving method and diagnostic error log

  1. Circle “all” or “every”.

  2. Identify the complete required Y set.

  3. Keep both X and Y in the numerator.

  4. Divide R(X,Y) by S(Y).

  5. Join or project after division. Otherwise, test that no required pair is missing.

Four traps recur: an existential join in Question 1, dropping sid in Question 4, reversing containment in Question 6, and confusing Question 8's ⌊m/n⌋ with Question 10's mn.

If you score 7/10 after missing Questions 4, 8 and 9, write Q4's schemas, test Q8 with m=11,n=3, and test Q9 with R={1,2}, S={x,y}. Retry without options. Next, use SQL Query MCQs: 12 Solved.

The short version and the next practice step

Division returns X values related to every required Y. One missing (X,Y) pair rejects a candidate. The numerator must contain both returned and divisor attributes.

Redo Question 7 without options. List A under b1, b2, b3 and b4, compare each with {a1,a2,a3}, and recover {b1,b4}. If needed, return to the six-pair example.

Use GATE Guidance by Sanchit Sir for structured DBMS learning, or the GATE Test Series for timed topic and full-length practice.