Vidyalelo
SQL · Q30

SQL

Programming · SQL · question 30

Q30

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');
Answer
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');

Answer: Option A

Solution

Answer: Option A
Solution:
To retrieve the names of cities with their respective temperature and condition where the condition is neither "sunny" nor "cloudy," you should use the SQL query SELECT city, temperature, condition FROM weather WHERE condition NOT IN ('sunny', 'cloudy'); (Option A). This query selects the desired columns from the "weather" table and filters the rows where the "condition" is not "sunny" or "cloudy." This way, you'll get the information for cities with conditions other than "sunny" or "cloudy."