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
Answer: Option C
Solution (By Examveda Team)
To retrieve all the cities along with their temperature, condition, and humidity where the humidity falls within the range of 63 to 79, you should use the SQL query SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79 (Option C). This query correctly uses the BETWEEN operator to specify the humidity range. It will include rows where the humidity value is equal to or greater than 63 and equal to or less than 79, thus giving you cities with humidity within the specified range. This is why Option C is the correct choice.
From the above query,
SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
represents the selection of all the data from the table weather with a WHERE condition between 63 and 79 represents the range between 63 and 79