Gate2018 cs Q18

0. Consider the following two tables and four queries in SQL.
Book (isbn, bname), Stock (isbn, copies)
Query 1 : SELECT B.isbn, S.copies
FROM Book B INNER JOIN
Stock S
ON B.isbn = S.isbn;
Query 2 : SELECT B.isbn, S.copies
FROM Book B LEFT OUTER
JOIN Stock S
ON B.isbn = S.isbn;
Query 3 : SELECT B.isbn, S.copies
FROM Book B RIGHT JOIN
Stock S
ON B.isbn = S.isbn;
Query 4 : SELECT B.isbn, S.copies
FROM Book B FULL OUTER
JOIN Stock S
ON B.isbn = S.isbn;
Which one of the queries above is certain to have an output that is superset of the outputs of the other three queries?

  • Option : D
  • Explanation :
    In the given Query 4 is full outer join so that full order join record set superset of records compare to inner join, left outer join & right outer join.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *