GATE / CS ARCHIVE

SIMILAR QUESTIONS / DATABASE MANAGEMENT SYSTEMS

Prove or refute dependency inference rules

3 questions solved the same way, newest first. Back to Database Management Systems

How these are solved

Apply attribute closure or Armstrong axioms to implications, and use a counterexample relation for invalid converse/rule claims. Do not infer a dependency from its reverse.

1 mark · MSQ
Report issue

Functional dependencies and counterexamples

Functional Dependencies & Keys

Question 30, GATE 2026: For attributes P,Q,R,S, assess: A PQ→R and P→R imply Q→R; B PQ→R implies P→R or Q→R; C P→R and Q→S imply PQ→RS; D P→R implies PQ→R.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: C, D

Step through it (4 parts)

Givens and goal

For attributes P,Q,R,S, assess: A PQ→R and P→R imply Q→R; B PQ→R implies P→R or Q→R; C P→R and Q→S imply PQ→RS; D P→R implies PQ→R.

Approach

Prove valid implications with agreement of tuples or Armstrong’s axioms, and refute invalid ones with small relations.

Step-by-step solution

1. To prove D, take two tuples agreeing on both P and Q. They agree on P, so P→R forces agreement on R. Adding an attribute to the determinant cannot invalidate a dependency. Thus D is true.
2. To prove C, two tuples agreeing on PQ agree on P and therefore R; they also agree on Q and therefore S. Hence they agree on RS, establishing PQ→RS. This is augmentation followed by union.
3. A is false. Consider the rows (P,Q,R,S)=(0,0,0,0) and (1,0,1,0). P uniquely determines R, and PQ also determines R. However the same Q=0 occurs with both R=0 and R=1, so Q→R fails. There is no “cancellation” rule for determinant attributes.
4. B is false. Use four rows with S fixed at 0 and R=P XOR Q:

    P Q R S
    0 0 0 0
    0 1 1 0
    1 0 1 0
    1 1 0 0

Every PQ pair has one R, so PQ→R holds. Holding only P fixed allows two R values, and holding only Q fixed does likewise. Neither individual dependency holds.
5. Therefore only C and D are always true. One relation satisfying the premises and violating the conclusion is sufficient to disprove each proposed universal inference.

Original paper, page 22 · Answer key

2 marks · MSQ
Report issue

Prove functional dependencies and refute a converse

Functional Dependencies & Keys

Question 44, GATE 2024: Which functional-dependency implications are valid? A XY→ZW implies X→ZW. B XY→ZW implies XY→Z. C XY→Z and W→Y imply XW→Z. D X→Y and Y→Z imply X→Z. Concatenated letters denote attribute sets.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, C, D

Step through it (4 parts)

Approach: Treat a functional dependency as a guarantee that equality on its left side forces equality on its right side. Use Armstrong-style inference or a concrete counterexample.
1. A is false: dropping a determinant attribute can lose information. Consider rows (X,Y,Z,W)=(0,0,0,0) and (0,1,1,1). Their XY values differ, so XY→ZW holds, but equal X values have different ZW values, violating X→ZW.
2. B is true by decomposition. If equal XY forces both Z and W to agree, it certainly forces Z alone to agree.
3. C is true. From equal XW, we have equal W, hence equal Y by W→Y. We now have equal XY, which forces equal Z by XY→Z. Equivalently, the closure of XW contains Y and then Z.
4. D is the transitivity rule: agreement on X gives agreement on Y, then on Z.
Answer: B, C and D. Decomposing the right-hand side is valid; arbitrarily decomposing the left-hand side is not.

Original paper, page 28 · Answer key

2 marks · MSQ
Report issue

Functional Dependencies & Keys

Question 40, GATE 2021: On U(P,Q,R,S,T), dependencies P→QR and RS→T hold. Which follow? A PS→T; B R→T; C P→R; D PS→Q.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A; C; D

Step through it (4 parts)

P→QR gives P→R and P→Q by decomposition. With PS, derive R and retain S, then RS→T gives PS→T; also PS→Q follows by augmentation and decomposition. Starting only from R yields closure{R}, so R→T is not implied. Therefore A, C, D.

Attribute closure of PS starts {P,S}, then adds Q,R using P→QR, then T using RS→T, giving all five attributes. Closure of P is {P,Q,R}, and closure of R is only {R}. The latter is a complete test of nonimplication: no listed dependency can fire from R alone, so S cannot be conjured merely because it appears beside R in RS→T.

Original paper, page 78 · Answer key