Which of the following query finds the total rating of the sailors who have reserved boat "103"?
A. SELECT SUM(s.rating) FROM sailors s, reserves r AND r.bid = 103;
B. SELECT s.rating FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
C. SELECT COUNT(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
D. SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
Answer: Option D
Solution(By Examveda Team)
To find the total rating of the sailors who have reserved boat "103," you should use the SQL query SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103; (Option D). This query correctly joins the "sailors" and "reserves" tables on the sailor ID (s.sid) and specifies the boat ID (r.bid) to be "103." It then calculates the sum of the ratings (s.rating) of the sailors who have reserved this boat. Option D is the correct choice for achieving this result.A. Structured Query Language
B. Structured Query List
C. Simple Query Language
D. None of these
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
A. Data Definition Language(DDL)
B. Data Manipulation Language(DML)
C. Both of above
D. None
Which operator performs pattern matching?
A. BETWEEN operator
B. LIKE operator
C. EXISTS operator
D. None of these
What operator tests column for the absence of data?
A. EXISTS operator
B. NOT operator
C. IS NULL operator
D. None of these
Join The Discussion