GATE / CS ARCHIVE

SIMILAR QUESTIONS / DATABASE MANAGEMENT SYSTEMS

Derive keys and test relation normal forms

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

How these are solved

Compute attribute closures to identify candidate keys and prime attributes, then test nontrivial dependencies against normal-form conditions. The 1995 proof shows 3NF but not BCNF for AB→C and C→A;

2 marks · MSQ
Report issue

Normalization & Decomposition

Question 46, GATE 2025: Relations have the following complete sets of functional dependencies:
R1(A,B,C,D,E): D→E, EA→B, EB→C.
R2(A,B,C,D): A→D, A→B, C→A.
Select true assertions: A. R1 is in 3NF; B. R2 is in 3NF; C. R1 is not in 3NF; D. R2 is not in 3NF.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: C, D

Step through it (2 parts)

For 3NF, every nontrivial dependency X→Y must have X a superkey or each right-hand attribute prime, meaning it belongs to some candidate key. Identify the keys before applying this test.

In R1, A and D never appear on any right-hand side, so neither can be obtained from other attributes and every key must contain both. Compute (AD)+: start with A,D; D→E adds E; EA→B adds B; EB→C adds C. Thus AD determines all five attributes and is the unique candidate key. Only A,D are prime. The dependency D→E violates 3NF: D+=DE is not a superkey and E is nonprime. Hence R1 is not in 3NF.

In R2, C never appears on a right-hand side and must belong to every key. C→A, followed by A→D and A→B, gives C+=ABCD, so C alone is the unique candidate key. A is not a superkey, since A+=ABD lacks C, and D,B are nonprime. Either A→D or A→B therefore violates 3NF. R2 is not in 3NF either. Select C,D.

Original paper, page 35 · Answer key

2 marks · MCQ
Report issue

3NF but not BCNF

Normalization & Decomposition

Question 42, GATE 2018: Schemas: I R(rollno,courses), courses set-valued, rollno→courses; II R(rollno,courseid,email), rollno,courseid→email and email→rollno; III R(rollno,courseid,marks,grade), rollno,courseid→marks,grade and marks→grade; IV R(rollno,courseid,credit), rollno,courseid→credit and courseid→credit. Which is 3NF but not BCNF? A I; B II; C III; D IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (4 parts)

Method

BCNF requires every nontrivial dependency’s determinant to be a superkey. 3NF allows a second possibility: its right-hand attribute is prime, meaning it belongs to some candidate key. For II, email together with courseid determines rollno and all attributes, while rollno together with courseid determines email. Neither email nor rollno alone determines courseid. Thus email→rollno violates BCNF but is permitted by 3NF because rollno is prime.

Solution

In schema II, candidate keys are {rollno, courseid} and {email, courseid}. All three attributes are prime, so each listed dependency satisfies 3NF. But email→rollno has a determinant that is not a superkey, violating BCNF. Schema I has a set-valued non-atomic attribute under the intended 1NF definition. Schema III has marks→grade with a non-superkey determinant and non-prime right side; schema IV has the analogous courseid→credit violation. Hence only schema II, B. The listed nontrivial dependencies are understood as a generating set, rather than literally excluding dependencies implied by them.

Original paper, page 18 · Answer key

2 marks · MCQ
Report issue

Normal form with key-implied dependencies

Normalization & Decomposition

Question 56, GATE 2009: For the preceding schema, supplier names and street names are unique within a city, and(sname, city) is a candidate key. No FDs other than those implied by primary/candidate keys are assumed. Choose A BCNF; B 3NF not BCNF; C 2NF not 3NF; D not 2NF.
Question 56, GATE 2009: For the preceding schema, supplier names and street names are unique within a city, and(sname, city) is a candidate key. No FDs other than those implied by primary/candidate keys are assumed. Choose A BCNF; B 3NF not BCNF; C 2NF not 3NF; D not 2NF.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The given primary keys are Suppliers.sid, Parts.pid, and Catalog.(sid, pid); Suppliers additionally has candidate key (sname, city). The question explicitly rules out functional dependencies other than those implied by primary and candidate keys. Consequently every nontrivial FD has a superkey as determinant, exactly the BCNF condition. All three relations are in BCNF, option A. Do not infer street→city from an address or infer sname alone is a key: the stipulated uniqueness is within a city and (sname, city) is explicitly the candidate key.

BCNF tests every nontrivial FD X→Y and requires X to be a superkey. The source explicitly permits only dependencies implied by the listed keys, so all such determinants qualify. Do not invent dependencies from the meaning of street or supplier name beyond the stated within-city uniqueness. Thus the schema meets BCNF and consequently the weaker normal forms as well; A is the strongest correct listed description.

Original paper, page 13

2 marks · MCQ
Report issue

Normal forms of Book and Collection

Normalization & Decomposition

Question 69, GATE 2008: Book(Title,Author,Catalog_no,Publisher,Year,Price) and Collection(Title,Author,Catalog_no) have key {Author,Title}. Dependencies: Title Author→Catalog_no; Catalog_no→Title Author Publisher Year; Publisher Title Year→Price. Which statement is true?

(A) Both are in BCNF
(B) Both are in 3NF only
(C) Book is in 2NF and Collection is in 3NF
(D) Both are in 2NF only
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (2 parts)

1. In Book, both {Title,Author} and {Catalog_no} are candidate keys. No given dependency makes a nonprime attribute depend on a proper subset of a candidate key, so Book is in 2NF.
2. Publisher,Title,Year→Price violates 3NF because its determinant is not a superkey and Price is nonprime. Collection has only Title, Author and Catalog_no; its nontrivial determinants are candidate keys, so it is BCNF and hence also 3NF.
3. Therefore C is true. The wording of C does not say Collection is only in 3NF.

Original paper, page 14

2 marks · MCQ
Report issue

Prime-attribute dependencies and normal form

Normalization & Decomposition

Question 50, GATE 2004: StudentPerformance(name,courseNo,rollNo,grade) has dependencies (name,courseNo)→grade; (rollNo,courseNo)→grade; name→rollNo; rollNo→name. What is its highest listed normal form?
Options:
(A) 2NF
(B) 3NF
(C) BCNF
(D) 4NF
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (8 steps)

1. The candidate keys are{name,courseNo} and{rollNo,courseNo}. Thus name,rollNo,courseNo are prime attributes, and grade is non-prime.

2. Dependencies from either key to grade satisfy 3NF. The non-key determinants name and rollNo determine only another prime attribute, so these dependencies also satisfy 3NF.

3. But name→rollNo and rollNo→name violate BCNF because neither determinant determines courseNo. Highest listed normal form is 3NF.

4. Teaching check: Compute closures: {name,courseNo}+ and {rollNo,courseNo}+ both contain all attributes, but name+ contains only name,rollNo. In 3NF a non-superkey determinant may determine a prime attribute; BCNF forbids that exception. This is exactly why the two normal forms differ here.

Original paper, page 7

2 marks · MCQ
Report issue

Normal form from only the listed dependencies

Normalization & Decomposition

Question 85, GATE 2003: The database functional dependencies are Date_of_birth→Age; Age→Eligibility; Name→Roll_number; Roll_number→Name; Course_number→Course_name; Course_number→Instructor; (Roll_number,Course_number)→Grade. Classify relation R(Roll_number,Name,Date_of_birth,Age):
A. In 2NF but not 3NF
B. In 3NF but not BCNF
C. In BCNF
D. None of the above
Use only the listed dependencies unless an additional identifying dependency is explicitly assumed.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Project the dependencies onto R. The relevant nontrivial ones are Roll_number→Name, Name→Roll_number and Date_of_birth→Age. No listed rule determines Date_of_birth from Roll_number or Name.
2. The closure of {Roll_number,Date_of_birth} contains all four attributes, and removing either attribute loses information. Likewise {Name,Date_of_birth} is a candidate key. Roll_number and Name alone are not keys under the stated dependency set.
3. Age is nonprime and depends on Date_of_birth, a proper subset of each composite candidate key. This is a partial dependency violating 2NF. Therefore none of A–C holds; D is the literal answer.
4. If one additionally assumes Roll_number→Date_of_birth, a single-attribute identifying key results and the usual 2NF-but-not-3NF answer A follows. The source does not supply that extra dependency, so it is a separate conditional interpretation.

Solution: Restrict the listed dependencies to R(Roll_number,Name,Date_of_birth,Age). They give Roll_number→Name, Name→Roll_number, and Date_of_birth→Age. Neither Name nor Roll_number determines Date_of_birth under this stated set. The candidate keys are therefore {Roll_number,Date_of_birth} and {Name,Date_of_birth}; Age is nonprime and depends on the proper key subset Date_of_birth. This violates 2NF, so the literal listed-dependency answer is D, none of the first three choices. If one additionally assumes Roll_number→Date_of_birth because roll numbers identify complete student records, Name and Roll_number become single-attribute keys and the relation is 2NF but not 3NF owing to Date_of_birth→Age, yielding A. That extra dependency is not supplied and must be labelled as an assumption.

Original paper, page 12

2 marks · MCQ
Report issue

Partial dependencies and normal form

Normalization & Decomposition

Question 6.9, GATE 1997: R(a, b, c, d) has atomic domains and only FDs a→c, b→d and their consequences. Which normal form applies?
Tap to enlarge
Your answer
Answer & solution

Answer: A: 1NF but not 2NF (no official key was published)

Step through it (4 steps)

Neither a nor b can be derived from the other attributes, so every key must contain both. The closure of ab includes c and d, so ab is the candidate key. Attribute c depends on only a, and d on only b, both proper subsets of that composite key. These are partial dependencies of nonprime attributes, violating 2NF. Atomic domains establish 1NF, so A is correct. The statement that no other independent FDs hold rules out an unstated single-attribute key that would alter this analysis.

Original paper, page 6

3 marks · Descriptive
Report issue

Third normal form without BCNF

Normalization & Decomposition

Question 26(a), GATE 1995: For R(A,B,C) with functional dependencies AB→C and C→A, show that R is in 3NF but not BCNF.
Question 26(a), GATE 1995: For R(A,B,C) with functional dependencies AB→C and C→A, show that R is in 3NF but not BCNF.
Tap to enlarge
Answer & solution

Answer: Candidate keys AB and BC make all attributes prime. C→A satisfies 3NF but violates BCNF since C is not a superkey. (no official key was published)

Step through it (7 steps)

Compute enough closures to identify the keys. (AB)+ contains A,B and gains C by AB→C, so AB is a superkey; neither A nor B alone determines all attributes, so it is minimal. (BC)+ gains A by C→A and is likewise a candidate key. Every candidate key must contain B because no dependency can introduce B. A key containing B must also include A or C, giving precisely AB and BC. Thus A,B,C are all prime attributes, meaning each occurs in at least one candidate key.

For 3NF, every nontrivial dependency X→Y with a single right-side attribute must have X a superkey or Y prime. The given AB→C has a superkey determinant. In C→A, C is not a superkey, but A is prime because it belongs to key AB. This is allowed in 3NF. In fact every attribute of R is prime, so any implied single-attribute dependency also meets that alternative of the definition. Hence R is in 3NF.

BCNF removes the prime-attribute exception: every nontrivial dependency must have a superkey on the left. Here C+={C,A}; it cannot acquire B, so C is not a superkey. The nontrivial dependency C→A therefore violates BCNF. Being in 3NF does not imply that every determinant is a key. This conclusion assumes the displayed dependencies generate the schema's constraints and that the relation is in first normal form, as is conventional for this normalization problem.

Original paper, page 8