MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
A
SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
B
SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
C
SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
D
SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);
Explanation: 

Detailed explanation-1: -Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy. (d) SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (’sunny’, ‘cloudy’); sql-server. laying-the-foundation.

Detailed explanation-2: -It can be used with the SELECT, INSERT, UPDATE and DELETE statement. The IN is a conditional operator used to reduce the use of multiple OR conditions in the SELECT, INSERT, UPDATE and DELETE statement. Hence the option B is the correct choice.

There is 1 question to complete.