Super keys with one candidate key of size k (n attributes)
2^(n − k)
Super keys with two candidate keys K1, K2
2^(n−|K1|) + 2^(n−|K2|) − 2^(n−|K1 ∪ K2|)
Maximum candidate keys in n attributes
C(n, ⌊n/2⌋) (all keys of the middle size)
Tables for a binary relationship
M:N → 3 tables; 1:N → 2 tables; 1:1 → 2 tables (1 if both total)
Key of a relationship table
M:N: both keys; 1:N: the key of the N side; 1:1: either key
What GATE asks from this
Question types seen repeatedly in past papers. More stars means more frequent.
★★★
Count tables / minimum tables for an ER diagram
Apply the mapping rules; merge when a 1:1 is total on both sides.
★★★
Number of super keys / candidate keys
Use 2^(n−k) or inclusion-exclusion for two keys.
★★★
Which operation violates referential integrity
Deleting or updating a referenced row, or inserting a foreign key with no matching parent.
Ratings are approximate, based on recurring patterns in past GATE CSE papers.
Previous year questions
9 real questions from the official GATE CSE papers (2011 to 2024), newest first, each with the official answer key and a worked solution. Questions are the property of the GATE organising institutes; this copy is for your personal study.
9 questions · 0 correct of 0 attempted · marks 0 / 10
Year:
GATE 2024 CS1 · Q20MCQ1 mark
Let S be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students." Which one of the following ER diagrams CORRECTLY represents S? (The four diagrams are described here in words.) (i) Instructor–Teaches–Course and Classroom–Allocation–Course are drawn, but Registration is drawn as a separate entity box attached to Course, and Student is joined to Course by a plain line with no Registration relationship. (ii) The entity at the bottom is Projects instead of Student: Instructor–Guides–Projects and Course–Registration–Projects. (iii) Instructor–Teaches–Course, Course–Registration–Student, Instructor–Guides–Student, but the Classroom box is joined to Course by a plain line that does not pass through the Allocation diamond. (iv) Instructor–Teaches–Course, Classroom–Allocation–Course, Course–Registration–Student, Instructor–Guides–Student, every relationship drawn as a diamond between the right pair of entity sets.
GATE 2024 CS2 · Q20MCQ1 mark
In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?
GATE 2024 CS1 · Q22MSQ1 mark
Which of the following statements about a relation R in first normal form (1NF) is/are TRUE?
One or more options may be correct. Select all that apply, then submit.
GATE 2020 · Q14MCQ1 mark
Which one of the following is used to represent the supporting many-one relationships of a weak entity set in an entity-relationship diagram?
GATE 2018 · Q11MCQ1 mark
In an Entity-Relationship (ER) model, suppose R is a many-to-one relationship from entity set E1 to entity set E2. Assume that E1 and E2 participate totally in R and that the cardinality of E1 is greater than the cardinality of E2. Which one of the following is true about R?
GATE 2016 Set 1 · Q21MCQ1 mark
Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z and primary key VY?
GATE 2012 Code A · Q14MCQ1 mark
Given the basic ER and relational models, which of the following is INCORRECT?
GATE 2012 Code A · Q43MCQ2 marks
Suppose R1(A, B) and R2(C, D) are two relation schemas (A and C are the keys). Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
GATE 2011 Code A · Q12MCQ1 mark
Consider a relational table with a single record for each registered student with the following attributes. 1. Registration_Num: unique registration number of each registered student. 2. UID: unique identity number, unique at the national level for each citizen. 3. BankAccount_Num: unique account number at the bank. A student can have multiple accounts or joint accounts. This attribute stores the primary account number. 4. Name: name of the student. 5. Hostel_Room: room number of the hostel. Which of the following options is INCORRECT?
Common traps
A candidate key is minimal; a super key need not be.
A foreign key may be NULL, a primary key may not.
An M:N relationship cannot be stored with a foreign key alone: it needs a table of its own.
A weak entity's partial key alone is not a key; add the owner key.