GATE DA 2025 · SQL Queries

MCQ · 1 mark · Problem DBMS-SQL-0039

Consider the following three relations:\(Car \; (model, year, \underline{serial}, color)\)\(Make \; (maker, \underline{model})\)\(Own \; (\underline{owner}, \underline{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; (\((\underline{owner}, \underline{serial})\)) together form the key for \(Own.\) (\(\bowtie\) denotes natural join)\(\pi_{\text{owner}} (\text{Own} \bowtie (\sigma_{\text{color} = \text{"red"}} (\text{Car} \bowtie (\sigma_{\text{maker} = \text{"ABC"}} \text{Make})) ))\)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

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solution\(Car(model,year,\underline{serial},color)\), \(Make(maker,\underline{model})\), \(Own(\underline{owner},\underline{serial})\) (or similar schema). A query joining across all three relations, filtered on \(color=\text{'red'}\) and \(maker=\text{'ABC'}\), and projecting the owner attribute, retrieves exactly the owners linked (via \(Own\) and \(Car\)) to a car that is both red and made by ABC (a single joint condition on the same car, not an "or" across separate cars, and not double-counting owners of multiple qualifying cars as a distinct category).Answer: All owners of a red car made by ABCClick Here for Detail SolutionGateOverflow discussion: https://gateoverflow.in/461015/gate-da-2025-question-7

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com