Question:

Based on the following schema,
sailors (sailor-id, sailpr-name, age):
boats (boat-id, boat-name, colour):
reserves (sailor id, boat id, day);
What does the following SQL query imply?
SELECT S.sailor_name FROM sailors S WHERE S.sailor_id IN
(SELECT R.sailor_id FROM reserves R WHERE R.boat_id >= 103);

Show Hint

Use \texttt{IN (SELECT ...)} to filter one table’s rows based on matching values from another related table.
Updated On: May 3, 2025
  • The number of the sailors whose names are same as that of the boat names.
  • The names of the sailors who are reserved for the boat number 10

  • The names of the sailors who have reserved boat number 10
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

(A)

Understand the schema:

  • (B) sailors(sailor_id, sailor_name, age)
  • (C) reserves(sailor_id, boat_id, day)

(D)

Break down the SQL query:

  • (E) Inner query:

SELECT R.sailor_id FROM reserves R WHERE R.boat_id >= 103

→ Gets all sailor_ids who have reserved boats with ID 103 or higher.

  • (F) Outer query:

SELECT S.sailor_name FROM sailors S WHERE S.sailor_id IN (...)

→ Gets names of those sailors from the sailors table who match the IDs found above.

(G)

Interpretation:

  • This query returns the names of sailors who have reserved any boat with an ID greater than or equal to 103.
  • So, Option (3) is the most accurate and complete interpretation.
Was this answer helpful?
0
0

Top Questions on SQL

View More Questions