Relational Algebra and SQL Queries Previous Year Questions (PYQs) for GATE DA: 9+ Solved Questions with Step-by-Step Solutions

    Solve 9+ Relational Algebra and SQL Queries previous year questions for GATE DA with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Relational Algebra and SQL Queries

    Your Learning Journey
    1

    Relational Algebra & Semantics

    Formal query language using mathematical operations. Highest weightage topic.

    2

    SQL Joins, Aggregation & Grouping

    Practical SQL implementation with table combinations and summary computations.

    3

    SQL Subqueries & Evaluation

    Nested queries and execution semantics. Understand internal processing.

    By the end of this chapter, you will:
    • Write queries in both relational algebra and SQL
    • Predict query results for any given database instance
    • Understand join semantics and aggregation behavior
    • Analyze nested queries and their execution order

    What is Relational Algebra?

    The Core Idea

    Relational algebra is a procedural query language that operates on relations (tables) to produce new relations.

    InputOne or two relations
    OutputA new relation (table)
    ProceduralSpecifies how to get the result
    ComposableOutput becomes next input

    The Six Fundamental Operations

    OperationSymbolPurpose
    SelectFilter rows
    ProjectFilter columns
    UnionCombine rows
    DifferenceRemove rows
    ProductAll combinations
    RenameRename attrs

    Relational Algebra and SQL Queries: Solved Questions with Step-by-Step Explanations (5 Problems)

    Question 1 · Database Management and Warehousing NAT
    On a relation named Loan of a bank:

    Loan
    loan number branch name amount
    L11 Banjara Hills 90000
    L14 Kondapur 50000
    L15 SR Nagar 40000
    L22 SR Nagar 25000
    L23 Balanagar 80000
    L25 Kondapur 70000
    L19 SR Nagar 65000

    the following SQL query is executed.

    SELECT L1.loan number
    FROM Loan L1
    WHERE L1.amount > (SELECT MAX (L2.amount)
                        FROM Loan L2
                        WHERE L2.branch name = ’SR Nagar’);

    The number of rows returned by the query is (Answer in integer)
    Question 2 · Database Management and Warehousing MCQ
    Consider a database that includes the following relations:
    Defender(name, rating, side, goals)
    Forward(name, rating, assists, goals)
    Team(name, club, price)
    Which ONE of the following relational algebra expressions checks that every name
    occurring in Team appears in either Defender or Forward, where denotes the
    empty set?
    1. A.

    2. B.

    3. C.

    4. D.

    Question 3 · Database Management and Warehousing MCQ
    Consider the given relations and . The relation has three columns and . The relation has three columns and . The relation has two columns and .


         
    P1   Q1   R1
    P2   Q2   R2
    P3   Q3   R2


         
    P1   Q1   2
    P1   Q2   5
    P2   Q1   6
    P3   Q3   1


      
    P1   T1
    P3   T2
    P4   T3
    P4   NULL

    Consider the relational algebra expression



    where denotes natural join operation.

    Which of the following options is the correct output for the given expression?
    1. A.

      Two rows (P1, R1, 2) and (P1, R1, 5)

    2. B.

      Three rows (P1, R1, 2), (P1, R1, 5) and (P2, R2, 6)

    3. C.

      One row (P1, R1, 2)

    4. D.

      Zero rows

    Question 4 · Database Management and Warehousing MCQ
    Consider the following three relations:

    Car (model, year, serial, color)
    Make (maker, model)
    Own (owner, serial)

    A tuple in Car represents a specific car of a given model, made in a given year, with a serial number and a color. A tuple in Make specifies that a maker company makes cars of a certain model. A tuple in Own specifies that an owner owns the car with a given serial number. Keys are underlined; (owner, serial) together form key for Own. ( denotes natural join)


    Which one of the following options describes what the above expression computes?
    1. A.

      All owners of a red car, a car made by ABC, or a red car made by ABC

    2. B.

      All owners of more than one car, where at least one car is red and made by ABC

    3. C.

      All owners of a red car made by ABC

    4. D.

      All red cars made by ABC

    Question 5 · Database Management and Warehousing NAT
    Consider the following two tables named Raider and Team in a relational database
    maintained by a Kabaddi league. The attribute ID in table Team references the
    primary key of the Raider table, ID.

    Raider
    IDNameRaidsRaidPoints
    1Arjun200250
    2Ankush190219
    3Sunil150200
    4Reza150190
    5Pratham175220
    6Gopal193215

    The SQL query described below is executed on this database:

    SELECT *
    FROM Raider, Team
    WHERE Raider.ID=Team.ID AND City=“Jaipur” AND
    RaidPoints > 200;

    The number of rows returned by this query is ______.

    Team
    CityIDBidPoints
    Jaipur2200
    Patna3195
    Hyderabad5175
    Jaipur1250
    Patna4200
    Jaipur6200

    More previous year questions (pyqs) in this unit

    chapter
    Relational Algebra and SQL Queries Previous Year Questions (PYQs) for GATE DA: 9+ Solved Questions with Step-by-Step Solutions

    Solve 9+ Relational Algebra and SQL Queries previous year questions for GATE DA with answers and detailed solutions. Free sample questions below.

    A question from this chapter

    Question 1
    On a relation named Loan of a bank:

    Loan
    loan number branch name amount
    L11 Banjara Hills 90000
    L14 Kondapur 50000
    L15 SR Nagar 40000
    L22 SR Nagar 25000
    L23 Balanagar 80000
    L25 Kondapur 70000
    L19 SR Nagar 65000

    the following SQL query is executed.

    SELECT L1.loan number
    FROM Loan L1
    WHERE L1.amount > (SELECT MAX (L2.amount)
                        FROM Loan L2
                        WHERE L2.branch name = ’SR Nagar’);

    The number of rows returned by the query is (Answer in integer)
    Question 2
    Consider a database that includes the following relations:
    Defender(name, rating, side, goals)
    Forward(name, rating, assists, goals)
    Team(name, club, price)
    Which ONE of the following relational algebra expressions checks that every name
    occurring in Team appears in either Defender or Forward, where denotes the
    empty set?
    Question 3
    Consider the given relations and . The relation has three columns and . The relation has three columns and . The relation has two columns and .


         
    P1   Q1   R1
    P2   Q2   R2
    P3   Q3   R2


         
    P1   Q1   2
    P1   Q2   5
    P2   Q1   6
    P3   Q3   1


      
    P1   T1
    P3   T2
    P4   T3
    P4   NULL

    Consider the relational algebra expression



    where denotes natural join operation.

    Which of the following options is the correct output for the given expression?
    Question 4
    Consider the following three relations:

    Car (model, year, serial, color)
    Make (maker, model)
    Own (owner, serial)

    A tuple in Car represents a specific car of a given model, made in a given year, with a serial number and a color. A tuple in Make specifies that a maker company makes cars of a certain model. A tuple in Own specifies that an owner owns the car with a given serial number. Keys are underlined; (owner, serial) together form key for Own. ( denotes natural join)


    Which one of the following options describes what the above expression computes?
    Question 5
    Consider the following two tables named Raider and Team in a relational database
    maintained by a Kabaddi league. The attribute ID in table Team references the
    primary key of the Raider table, ID.

    Raider
    IDNameRaidsRaidPoints
    1Arjun200250
    2Ankush190219
    3Sunil150200
    4Reza150190
    5Pratham175220
    6Gopal193215

    The SQL query described below is executed on this database:

    SELECT *
    FROM Raider, Team
    WHERE Raider.ID=Team.ID AND City=“Jaipur” AND
    RaidPoints > 200;

    The number of rows returned by this query is ______.

    Team
    CityIDBidPoints
    Jaipur2200
    Patna3195
    Hyderabad5175
    Jaipur1250
    Patna4200
    Jaipur6200
    Free preview ends here

    Login to view the complete previous-year 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.

    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.