GATE CSE Relational Model and SQL PYQs
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.
- GATE CSE 2026 Set 1 · Q43Consider a relational database schema with two relations and . Let be a tuple relational calculus expression. Which one of the following relational algebraic expressions is…MCQ2 marksEasySolve
- GATE CSE 2025 Set 1 · Q39Consider two relations describing and in a sports league: • : are team-id and team-name, respectively • : , and denote player-id, player-name and the team-id of the player, respectively Which ONE of the…MCQ2 marksEasySolve
- GATE CSE 2024 Set 2 · Q45The relation schema,
Person(pid,city), describes the city of residence for every person uniquely identified bypid. The following relational algebra operators are available:selection,projection,cross product, andrename. To find the list…MCQ2 marksMediumSolve - GATE CSE 2023 · Q16Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?MCQ1 markEasySolve
- GATE CSE 2022 · Q25Consider the following three relations in a relational database. , , Which of the following relational algebra expressions return the set of who own all the brands?MSQ1 markMediumSolve
- GATE CSE 2021 Set 1 · Q23A relation in a relational database has 1200 tuples. The attribute has integer values ranging from 6 to 20, and the attribute has integer values ranging from 1 to 20. Assume that the attributes and are independently distributed. The estimated number of tuples in the output of …NAT1 markMediumSolve
- GATE CSE 2017 Set 1 · Q23Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given below. The output of executing the SQL query is _________.NAT1 markEasyDiagramSolve
- GATE CSE 2017 Set 1 · Q41Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus. (I) …MCQ2 marksHardSolve
- GATE CSE 2017 Set 1 · Q46Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below. The following query is made on the database. The number of…NAT2 marksMediumDiagramSolve
- GATE CSE 2017 Set 2 · Q46Consider the following database table named
top_scorer. Consider the following SQL query:SELECT ta.player FROM top_scorer AS ta WHERE ta.goals >ALL (SELECT tb.goals FROM top_scorer AS tb WHERE tb.country = 'Spain') AND ta.goals >ANY (SELECT tc.goals FROM top_scorer AS tc WHERE tc.country = 'Germany')…NAT2 marksMediumDiagramSolve - GATE CSE 2014 Set 2 · Q54SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below:
select * from R where a in (select S.a from S)MCQ2 marksMediumSolve - GATE CSE 2014 Set 3 · Q30Consider the relational schema given below, where
eIdof the relationdependentis a foreign key referring toempIdof the relationemployee. Assume that every employee has at least one associated dependent in thedependentrelation.employee (empId, empName, empAge)…MCQ2 marksMediumSolve - GATE CSE 2013 · Q11Match the problem domains in GROUP I with the solution technologies in GROUP II.MCQ1 markEasyDiagramSolve
- GATE CSE 2013 · Q35Consider the following relational schema. …MCQ2 marksEasySolve
- GATE CSE 2011 · Q46Database table by name
Loan_Recordsis given below. What is the output of the following SQL query?SELECT count(*) FROM ( (SELECT Borrower, Bank_Manager FROM Loan_Records) AS S NATURAL JOIN (SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T );MCQ2 marksEasyDiagramSolve
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, 2013Given 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, 2011Given 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, 2014Identifying algebraic expressions or set-difference formulations () that correctly capture 'for all' requirements, or calculating division results.
SQL Subquery Semantics and Quantification (>ALL / >ANY / IN)
OccasionalMCQ2 marks2017, 2014Analyzing 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 marks2021Calculating 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 marks2024Determining the minimum number of primitive RA operators (like Cartesian products or self-joins) required to simulate non-aggregate constraints like 'at least ' occurrences.
Safety and Domain Independence of Calculus Expressions
RareMCQ2 marks2017Determining 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 marks2023Direct 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 marks2013Matching 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
Used when rewriting or validating relational division in terms of projection, Cartesian product, and set difference.
Disjunctive Selection Selectivity (Independent Attributes)
Used to compute estimated result size for queries with OR conditions over independent attribute distributions.
Minimum Cross Products for k-element Comparison
Used to find the minimum number of binary cross products needed to join instances of a relation for counting-based constraints in pure relational algebra.
SQL >ALL on Empty Set Identity
Used when evaluating SQL queries where a subquery referenced in an ALL comparison returns zero rows.
Degree (Arity) of a Relation
Determining the arity or degree of a relation schema .
Cardinality of a Relation
Determining the number of rows/tuples in an instance of relation .
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.