chapter

    Databases Practice Questions for Gate Cs

    GATE CS Databases: 1 units and 5 chapters, weightage from 48 previous year questions across 10 papers, a study order by exam weight and 1320 practice question

    A question from this chapter

    Question 1
    Level 1: Warm-up

    Consider the specification: "Each Project is managed by exactly one Department. Each Department manages at least one Project." Which one of the following statements about the ER diagram for this specification is TRUE?

    Question 2
    Level 1: Warm-up

    Which of the following SQL queries is valid according to the GROUP BY SELECT list constraint?

    Question 3
    Level 1: Warm-up

    Translate the following description into the order in which attributes enter the closure during the standard attribute-closure algorithm on starting from :

    "Begin with ; repeatedly append the right-hand sides of every dependency whose left-hand side is already contained in the current result, until nothing new can be appended."

    Rank the attributes by the round in which they first appear (round 1 = initial set). Choose the correct ordering of first-appearance rounds for .

    Question 4
    Level 1: Warm-up

    In a B+ tree, when an internal node splits due to overflow, what happens to the median key?

    Question 5
    Level 1: Warm-up

    Assertion (A): A schedule is conflict serializable if its precedence graph contains no cycles.

    Reason (R): The nodes of the precedence graph represent the data items, and the edges represent the transactions.

    Free preview ends here

    Login to view the complete practice questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Databases Practice Questions for GATE CS

    GATE CS Databases: 1 units and 5 chapters, weightage from 48 previous year questions across 10 papers, a study order by exam weight and 1320 practice questions.

    About Databases Practice Questions

    1320 practice questions for Databases in GATE CS, sorted chapter by chapter and graded from basic to exam level, each with a full solution.

    GATE CS Databases Unit-wise Weightage from Past Papers

    We counted every GATE CS Databases previous year question in our bank (48 questions from 10 papers) and grouped them by unit.

    UnitChaptersPYQsShare of sectionAvg per paper
    Databases548100%4.8

    Suggested Databases Study Order for GATE CS

    1. Databases: 100% of past Databases questions, about 4.8 per paper.

    Start where the marks are. Units at the top of this list have appeared most often in past GATE CS papers.

    Units in GATE CS Databases

    All Databases chapters

    One Solved Question from Each Databases Chapter

    Question 1 · Relational Model, ER Design and Schema Architecture MCQ

    Consider the specification: "Each Project is managed by exactly one Department. Each Department manages at least one Project." Which one of the following statements about the ER diagram for this specification is TRUE?

    1. A.

      The relationship between Department and Project is many-to-many

    2. B.

      Project is a weak entity set with Department as its owner

    3. C.

      The relationship from Department to Project has cardinality 1:N

    4. D.

      Department has partial participation in the managing relationship

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: Translate the English specification into ER constraints step by step.

    Step 1: "Each Project is managed by exactly one Department" → For each Project, there is exactly one Department. This means from Project to Department, it is N:1, or equivalently, from Department to Project, it is 1:N.

    Step 2: "Each Department manages at least one Project" → Every Department must manage at least one Project. This means Department has total participation in the relationship.

    Step 3: Evaluate options:

    • A: Many-to-many → False, it is 1:N.
    • B: Project is weak → False, no indication Project depends on Department for identification.
    • C: 1:N from Department to Project → True, matches Step 1.
    • D: Partial participation for Department → False, "at least one" means total participation.

    Answer: C

    Question 2 · Relational Algebra, Tuple Calculus and SQL MCQ

    Which of the following SQL queries is valid according to the GROUP BY SELECT list constraint?

    1. A.

      SELECT dept_id, name, MAX(salary) FROM emp GROUP BY dept_id

    2. B.

      SELECT dept_id, MAX(salary) FROM emp GROUP BY dept_id

    3. C.

      SELECT name, MAX(salary) FROM emp GROUP BY dept_id

    4. D.

      SELECT dept_id, name, salary FROM emp GROUP BY dept_id

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a bounding question on the strict syntactic rules of the GROUP BY clause.

    Step 1: Recall the GROUP BY SELECT list constraint. Every column in the SELECT list must either be included in the GROUP BY clause or be an argument to an aggregate function.

    Step 2: Evaluate Option A: name is in SELECT but not in GROUP BY and not aggregated. (Invalid)

    Step 3: Evaluate Option B: dept_id is in GROUP BY. MAX(salary) is aggregated. (Valid)

    Step 4: Evaluate Option C: name is in SELECT but not in GROUP BY and not aggregated. (Invalid)

    Step 5: Evaluate Option D: name and salary are in SELECT but not in GROUP BY and not aggregated. (Invalid)

    Answer: SELECT dept_id, MAX(salary) FROM emp GROUP BY dept_id

    Question 3 · Functional Dependencies, Keys and Normalization MCQ

    Translate the following description into the order in which attributes enter the closure during the standard attribute-closure algorithm on starting from :

    "Begin with ; repeatedly append the right-hand sides of every dependency whose left-hand side is already contained in the current result, until nothing new can be appended."

    Rank the attributes by the round in which they first appear (round 1 = initial set). Choose the correct ordering of first-appearance rounds for .

    1. A.

      in round 2, in round 3, in round 4

    2. B.

      all in round 2

    3. C.

      in round 2, in round 2, in round 3

    4. D.

      in round 3, in round 2, in round 4

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is an order-ranking question translating the iterative closure procedure into concrete rounds.

    Step 1: Round 1: result .

    Step 2: Round 2: scan . applies (), append . does not yet apply. New result . First appearance of = round 2.

    Step 3: Round 3: now applies (), append . Result . First appearance of = round 3.

    Step 4: Round 4: now applies, append . Result . First appearance of = round 4.

    Ordering: B(2), C(3), D(4). Answer: A

    Wrong path: Believing all applicable-at-start FDs fire simultaneously regardless of newly added attributes causes option B/C-style answers; this overcounts early additions.

    Question 4 · File Organization, Indexing and B+ Trees MCQ

    In a B+ tree, when an internal node splits due to overflow, what happens to the median key?

    1. A.

      It is copied to the parent and remains in the internal node

    2. B.

      It is deleted from the tree

    3. C.

      It is moved to the parent and removed from the internal node

    4. D.

      It is copied to both the parent and the sibling node

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This tests the critical difference between leaf splits and internal node splits. In a B+ tree: - Leaf split: The separator key is copied to the parent and remains in the right leaf - Internal node split: The median key is moved to the parent and removed from the current node This difference exists because internal nodes don't store data — they only guide searches. The median key must move up to maintain the search structure. Answer: It is moved to the parent and removed from the internal node
    Question 5 · Transactions, Concurrency Control and Recovery MCQ

    Assertion (A): A schedule is conflict serializable if its precedence graph contains no cycles.

    Reason (R): The nodes of the precedence graph represent the data items, and the edges represent the transactions.

    1. A.

      Both A and R are true and R is the correct explanation of A

    2. B.

      Both A and R are true but R is NOT the correct explanation of A

    3. C.

      A is true but R is false

    4. D.

      A is false but R is true

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: The precedence graph uses transactions as nodes and conflicts as directed edges.

    Step 1: Evaluate Assertion (A). The golden rule of the precedence graph method is that an acyclic graph (no cycles) means the schedule is conflict serializable. Assertion (A) is true.

    Step 2: Evaluate Reason (R). The reason states that nodes are data items and edges are transactions. This is backwards. The nodes represent the transactions (), and the directed edges represent the conflicts (e.g., ). Reason (R) is false.

    Answer: A is true but R is false.