Sail E0 Webinar

MCQs

Total Questions : 126 | Page 11 of 13 pages
Question 101. Find the names of the countries whose condition is sunny.
  1.    SELECT country FROM location WHERE city NOT IN (SELECT city FROM weather WHERE condition = 'sunny');
  2.    SELECT country FROM location WHERE city UNION (SELECT city FROM weather WHERE condition = 'sunny');
  3.    SELECT country FROM location WHERE condition = 'sunny';
  4.    SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = sunny');
 Discuss Question
Answer: Option D. -> SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = sunny');
Question 102. Which of the following query finds colors of boats reserved by "Dustin"?
  1.    SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND r.bid = b.bid
  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, sailors s WHERE s.sname = 'Dustin' AND s.sid = b.sid
 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 103. Find the name of all cities with their temperature, humidity and countries.
  1.    SELECT weather.city, temperature, humidity, country FROM weather, location;
  2.    SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;
  3.    SELECT weather.city, temperature, humidity FROM weather SELECT country FROM location WHERE weather.city = location.city;
  4.    SELECT city, temperature, humidity, country FROM location;
 Discuss Question
Answer: Option B. -> SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;
Question 104. 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 and 89);
  2.    SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;
  3.    SELECT * FROM weather WHERE temperature NOT BETWEEN 71 to 89;
  4.    SELECT * FROM weather WHERE temperature NOT IN (71 to 89);
 Discuss Question
Answer: Option B. -> SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;
Question 105. Which of the following query finds the names of the sailors who have reserved at least one boat?
  1.    SELECT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
  2.    None of These
  3.    SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;
  4.    SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
 Discuss Question
Answer: Option D. -> SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
Question 106. The SELECT statement SELECT 'Hi' FROM DUAL WHERE NULL = NULL; Outputs
  1.    Hi
  2.    TRUE
  3.    FLASE
  4.    Nothing
 Discuss Question
Answer: Option D. -> Nothing
Question 107. Which of the following is illegal?
  1.    SELECT SYSDATE - (SYSDATE - 2) FROM DUAL;
  2.    None of these
  3.    SELECT SYSDATE - (SYSDATE + 2) FROM DUAL;
  4.    SELECT SYSDATE - SYSDATE FROM DUAL;
 Discuss Question
Answer: Option B. -> None of these
Question 108. Which of the following query finds the total rating of the sailors who have reserved boat "103"?
  1.    c) SELECT COUNT(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
  2.    SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
  3.    SELECT SUM(s.rating) FROM sailors s, reserves r AND r.bid = 103;
  4.    SELECT s.rating FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
 Discuss Question
Answer: Option B. -> SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
Question 109. What does the following query find?(SELECT DISTINCT r.sidFROM boats b, reserves rWHERE b.bid = r.bidAND b.color = 'red')MINUS(SELECT DISTINCT r.sidFROM boats b, reserves rWHERE b.bid = r.bidAND b.color = 'green')
  1.    Find the sailor IDs of at least one sailor who have reserved red boats but not green boats
  2.    Find the sailor Ids of atmost one sailor who have reserved red boats but not green boats
  3.    Find the sailor IDs of all sailors who have reserved red boats but not green boats
  4.    None of These
 Discuss Question
Answer: Option C. -> Find the sailor IDs of all sailors who have reserved red boats but not green boats
Question 110. 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 COUNT(r1.bid) > r2.bid
  2.    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
  3.    All of these
  4.    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
 Discuss Question
Answer: Option D. -> 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

Latest Videos

Latest Test Papers