ISRO 2017 · SQL Queries

MCQ · 1 mark · Problem DBMS-SQL-0074

\[\begin{array}{|l|l|l|l|l|} \hline \textbf{Employee} & \textbf{Department} & \textbf{OT allowance} \\ \hline \text{RAMA} & \text{Mechanical} & \text{5000} \\\hline \text{GOPI} & \text{Electrical} & \text{2000} \\\hline \text{SINDHU} & \text{Computer} & \text{4000} \\\hline \text{MAHESH} & \text{Civil} & \text{1500} \\\hline \end{array}\]What is the output of the following SQL query?
select count(*) from
   ((select Employee, Department from Overtime_allowance)
   natural join
   (select Department, OT_allowance from Overtime_allowance)
   as T);
  1. A
    16
  2. B
    4
  3. C
    8
  4. D
    None of the above

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

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/128552/isro2017-7

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