GateAI

GATE CSE Relational Model and SQL PYQs

Standard yield14.2% of Databases

GATE tests the relational model across three interrelated formalisms: Relational Algebra (RA), Relational Calculus (TRC/DRC), and SQL. Questions evaluate core s… Read the guide

Questions
15
Asked
since 2011
Total marks
25
Marks / paper
1

15 GATE CSE Relational Model and SQL PYQs with solutions, from Databases. Browse all GATE CSE PYQs.

Questions

Every official paper that asked this topic, newest first.

What GATE tests in Relational Model and SQL

Concepts, patterns, formulas and traps distilled from past papers.

GATE tests the relational model across three interrelated formalisms: Relational Algebra (RA), Relational Calculus (TRC/DRC), and SQL. Questions evaluate core semantic equivalences, translation between declarative calculi and algebraic operators, table instance tracing (such as joins, group-by aggregations, and division), and corner cases like SQL three-valued logic, duplicate preservation, and safe TRC expressions.

Core concepts

  • Relational Algebra fundamental operators: Selection, Projection, Cross Product, Set Difference, Union, Rename
  • Derived RA operators: Natural Join, Theta Join, Relational Division
  • Tuple Relational Calculus (TRC) and Domain Relational Calculus (DRC) syntax and quantifiers (∃, ∀)
  • Safe TRC expressions and domain independence
  • Relational Division and 'for all' universal quantification implementations
  • SQL nested subqueries: IN, ALL, ANY / SOME
  • SQL duplicate preservation vs. set semantics in relational algebra
  • SQL GROUP BY and nested aggregate functions (AVG of COUNT)
  • Selectivity and cardinality estimation under uniform distribution
  • Degree (Arity) of a relation
  • Cardinality of a relation instance
  • Relation schema vs. relation instance
  • Attribute domains and distinct domain sets
  • Tuples and attributes
  • Information representation (XML / semi-structured data)
  • Service-Oriented Architecture and computing (Publish-find-bind model)
  • Heterogeneous system communication (Interoperability)
  • Workflow and business process modeling (BPMN)

Recurring question patterns

  • Query Equivalence and Cross-Formalism Translation

    CommonMCQ2 marks2026, 2025, 2013

    Given an English requirement or an expression in TRC/DRC/SQL, identifying the equivalent representation in Relational Algebra or another query language.

  • Table Instance Execution & Output Size Calculation

    CommonNAT2 marks2017, 2011

    Given one or more relation tables, tracing the exact output tuples or computing numeric aggregates (e.g., COUNT, AVG, natural join cardinality, relational division output size).

  • Relational Division and 'Universal / For All' Semantics

    CommonMSQ1.5 marks2022, 2017, 2014

    Identifying algebraic expressions or set-difference formulations (R−(R×S−T)R - (R \times S - T)) that correctly capture 'for all' requirements, or calculating division results.

  • SQL Subquery Semantics and Quantification (>ALL / >ANY / IN)

    OccasionalMCQ2 marks2017, 2014

    Analyzing behavior of nested SQL queries with set membership (IN) or set comparisons (>ALL, >ANY), specifically testing empty set and duplicate handling.

  • Query Selectivity & Cardinality Estimation

    OccasionalNAT1 marks2021

    Calculating the expected number of output tuples given uniform and independent attribute value distributions under compound boolean selection predicates.

  • Expressive Power and Operator Counting in Pure RA

    OccasionalMCQ2 marks2024

    Determining the minimum number of primitive RA operators (like Cartesian products or self-joins) required to simulate non-aggregate constraints like 'at least kk' occurrences.

  • Safety and Domain Independence of Calculus Expressions

    RareMCQ2 marks2017

    Determining whether given TRC/DRC queries are safe (i.e., guaranteed to return a finite relation drawn strictly from the database domain).

  • Relational Terminology Identification

    RareMCQ1 marks2023

    Direct conceptual questions asking for the definition or distinction between structural relational terms such as degree, arity, cardinality, domains, or tuples.

  • Match Domain Concepts to Solution Technologies

    RareMCQ1 marks2013

    Matching conceptual problem areas (such as information representation, process workflows, computing architecture, or system communication) with standard industry paradigms/technologies (such as XML, BPMN, Publish-find-bind, or Interoperability).

Formulas GATE uses

Relational Division Definition via Fundamental Operators

R(A,B)÷S(B)=ΠA(R)−ΠA((ΠA(R)×S)−R)R(A, B) \div S(B) = \Pi_A(R) - \Pi_A((\Pi_A(R) \times S) - R)

Used when rewriting or validating relational division in terms of projection, Cartesian product, and set difference.

Disjunctive Selection Selectivity (Independent Attributes)

P(C1∨C2)=P(C1)+P(C2)−(P(C1)⋅P(C2))P(C_1 \lor C_2) = P(C_1) + P(C_2) - (P(C_1) \cdot P(C_2))

Used to compute estimated result size for queries with OR conditions over independent attribute distributions.

Minimum Cross Products for k-element Comparison

Minimum cross products=k−1\text{Minimum cross products} = k - 1

Used to find the minimum number of binary cross products needed to join kk instances of a relation for counting-based constraints in pure relational algebra.

SQL >ALL on Empty Set Identity

val>ALL(∅)=TRUE\text{val} > \text{ALL}(\emptyset) = \text{TRUE}

Used when evaluating SQL queries where a subquery referenced in an ALL comparison returns zero rows.

Degree (Arity) of a Relation

Degree(R)=∣Attributes(R)∣\text{Degree}(R) = |\text{Attributes}(R)|

Determining the arity or degree of a relation schema RR.

Cardinality of a Relation

Cardinality(R)=∣Tuples(R)∣\text{Cardinality}(R) = |\text{Tuples}(R)|

Determining the number of rows/tuples in an instance of relation RR.

Examiner traps in Relational Model and SQL

  • Assuming SQL joins preserve the exact duplicate semantics of an `IN (subquery)` without deduplicating the inner subquery table.
  • Forgetting that `> ALL (empty set)` evaluates to TRUE in SQL, rather than FALSE or NULL.
  • Overlooking that set difference A(R) - A( condition(R S)) expresses universal negation ('for all') rather than existential ('for some').
  • Confusing relational division divisor vs. quotient schemas (e.g., dividing by (Own) instead of the full universe (Brand)).
  • Forgetting that combining k relation instances requires k-1 binary Cartesian product operators, not k.
  • Neglecting duplicate elimination in Relational Algebra projections compared to SQL `SELECT` without `DISTINCT`.
  • Confusing degree (number of attributes/columns) with cardinality (number of tuples/rows).
  • Assuming the degree equals the number of distinct domains (multiple attributes can share the exact same underlying domain, e.g., sourcecity and destcity).
  • Confusing the total cell count (degree × cardinality) with either degree or cardinality.
  • Confusing process description standards (e.g., BPMN) with data representation standards (e.g., XML/JSON).
  • Mixing architectural mechanisms (e.g., Publish-find-bind) with overarching requirements (e.g., Interoperability).

How questions are asked

  • Table trace to find aggregate value (NAT)
  • Table trace to count result tuples after subquery filters (NAT)
  • Match English query to equivalent SQL, RA, TRC, DRC expressions (MCQ)
  • Identify equivalent fundamental RA expressions for relational division (MSQ)
  • Count minimum operators required to express a query (MCQ)
  • Estimate result cardinality using selectivity probability (NAT)
  • Identify safe vs unsafe calculus expressions (MCQ)
  • definition recall MCQ
  • Match the following (Group I to Group II 4x4 mapping)

Paper trends

  • Shift from simple table tracing and SQL syntax evaluation towards deep algebraic identities, minimum operator bounds, and foundational TRC/DRC syntax matching.

    2026, 2025, 2024, 2022, 2014, 2013, 2011

  • Adoption of NAT and MSQ question formats to test numerical tracing (aggregates, table rows, selectivity estimation) and multiple equivalent formulations of relational division.

    2022, 2021, 2017

  • Direct textbook terminology was introduced as a 1-mark standalone MCQ testing precise relational definitions.

    2023

  • Appeared as a 1-mark breadth-oriented matching MCQ bridging database data models (XML) and enterprise architecture concepts.

    2013

Difficulty notes

Easy questions require standard TRC-to-RA translations, basic SQL aggregation on given tables, or straightforward join counts. Medium questions involve relational division equivalence, SQL nested subquery semantics with duplicates/empty sets, or algebraic operator minimization. Hard questions involve subtle calculus safety proofs, domain-independence edge cases, or multi-nested quantified calculus translations.