Sail E0 Webinar

MCQs

Total Questions : 109 | Page 5 of 11 pages
Question 41. Find all the tuples having temperature greater than 'Paris'.
  1.    SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = 'Paris')
  2.    SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = 'Paris')
  3.    SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = 'Paris')
  4.    SELECT * FROM weather WHERE temperature > 'Paris' temperature
 Discuss Question
Answer: Option A. -> SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = 'Paris')
Question 42. Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79
  1.    SELECT * FROM weather WHERE humidity IN (63 to 79)
  2.    SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
  3.    SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
  4.    SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79
 Discuss Question
Answer: Option C. -> SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
Question 43. Find the names of the countries whose condition is sunny.
  1.    SELECT country FROM location WHERE condition = 'sunny';
  2.    SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = sunny');
  3.    SELECT country FROM location WHERE city NOT IN (SELECT city FROM weather WHERE condition = 'sunny');
  4.    SELECT country FROM location WHERE city UNION (SELECT city FROM weather WHERE condition = 'sunny');
 Discuss Question
Answer: Option B. -> SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = sunny');
Question 44. Find the name of all cities with their temperature, humidity and countries.
  1.    SELECT city, temperature, humidity, country FROM location;
  2.    SELECT weather.city, temperature, humidity, country FROM weather, location;
  3.    SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;
  4.    SELECT weather.city, temperature, humidity FROM weather SELECT country FROM location WHERE weather.city = location.city;
 Discuss Question
Answer: Option C. -> SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;
Question 45. Find the name of cities with all entries whose temperature is in the range of 71 and 89
  1.    SELECT * FROM weather WHERE temperature NOT IN (71 to 89);
  2.    SELECT * FROM weather WHERE temperature NOT IN (71 and 89);
  3.    SELECT * FROM weather WHERE temperature NOT BETWEEN 71 to 89;
  4.    SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;
 Discuss Question
Answer: Option D. -> SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;
Question 46. Which of the following query finds the names of the sailors who have reserved at least one boat?
  1.    SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
  2.    SELECT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
  3.    SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;
  4.    None of These
 Discuss Question
Answer: Option A. -> SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
Question 47. Which of the following query finds colors of boats reserved by "Dustin"?
  1.    SELECT DISTINCT b.color FROM boats b, sailors s WHERE s.sname = 'Dustin' AND s.sid = b.sid
  2.    SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND s.sid = r.sid AND r.bid = b.bid;
  3.    SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND s.sid = r.sid
  4.    SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND r.bid = b.bid
 Discuss Question
Answer: Option B. -> SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND s.sid = r.sid AND r.bid = b.bid;
Question 48. What does the following query find?
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'red')
MINUS
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'green')
  1.    Find the sailor IDs of all sailors who have reserved red boats but not green boats
  2.    Find the sailor IDs of at least one sailor who have reserved red boats but not green boats
  3.    Find the sailor Ids of atmost one sailor who have reserved red boats but not green boats
  4.    None of These
 Discuss Question
Answer: Option A. -> Find the sailor IDs of all sailors who have reserved red boats but not green boats
Question 49. Which of the following query finds the name of the sailors who have reserved at least two boats?
  1.    SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND r1.sid = r2.sid AND r1.bid ≠ r2.bid
  2.    SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND COUNT(r1.bid) > r2.bid
  3.    SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND r1.sid = r2.sid AND r1.bid r2.bid
  4.    All of these
 Discuss Question
Answer: Option C. -> SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND r1.sid = r2.sid AND r1.bid r2.bid
Question 50. Which of the following query finds the total rating of the sailors who have reserved boat "103"?
  1.    SELECT SUM(s.rating) FROM sailors s, reserves r AND r.bid = 103;
  2.    SELECT s.rating FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
  3.    c) SELECT COUNT(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
  4.    SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
 Discuss Question
Answer: Option D. -> SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103

Latest Videos

Latest Test Papers