191. Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70 oF.
A. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70;
B. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70;
C. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70;
D. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70;

192. Find all the tuples having temperature greater than ‘Paris’.
A. SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’)
B. SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)
C. SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)
D. SELECT * FROM weather WHERE temperature > ‘Paris’ temperature

193. Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79
A. SELECT * FROM weather WHERE humidity IN (63 to 79)
B. SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
C. SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
D. SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79

194. Find the names of the countries whose condition is sunny.
A. SELECT country FROM location WHERE condition = ‘sunny’;
B. SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = sunny’);
C. SELECT country FROM location WHERE city NOT IN (SELECT city FROM weather WHERE condition = ‘sunny’);
D. SELECT country FROM location WHERE city UNION (SELECT city FROM weather WHERE condition = ‘sunny’);

195. Find the name of all cities with their temperature, humidity and countries.
A. SELECT city, temperature, humidity, country FROM location;
B. SELECT weather.city, temperature, humidity, country FROM weather, location;
C. SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;
D. SELECT weather.city, temperature, humidity FROM weather SELECT country FROM location WHERE weather.city = location.city;

196. Find the name of cities with all entries whose temperature is in the range of 71 and 89
A. SELECT * FROM weather WHERE temperature NOT IN (71 to 89);
B. SELECT * FROM weather WHERE temperature NOT IN (71 and 89);
C. SELECT * FROM weather WHERE temperature NOT BETWEEN 71 to 89;
D. SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;

197. Which of the following query finds the names of the sailors who have reserved at least one boat?
A. SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
B. SELECT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
C. SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;
D. None of These

198. Which of the following query finds colors of boats reserved by “Dustin”?
A. SELECT DISTINCT b.color FROM boats b, sailors s WHERE s.sname = ‘Dustin’ AND s.sid = b.sid
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;
C. SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = ‘Dustin’ AND s.sid = r.sid
D. SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = ‘Dustin’ AND r.bid = b.bid

199. 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’)
A. Find the sailor IDs of all sailors who have reserved red boats but not green boats
B. Find the sailor IDs of at least one sailor who have reserved red boats but not green boats
C. Find the sailor Ids of at most one sailor who have reserved red boats but not green boats
D. None of These

200. Which of the following query finds the name of the sailors who have reserved at least two boats?
A. 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
B. SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND COUNT(r1.bid) > r2.bid
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
D. All of these

Leave a Reply