1.

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’);I have been asked this question during an interview for a job.Origin of the question is Basic SQL topic in portion Laying the Foundation of SQL Server

Answer»

The CORRECT ANSWER is (a) SELECT CITY, TEMPERATURE, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)

The best explanation: The IN operator allows you to specify multiple VALUES in a WHERE clause.



Discussion

No Comment Found

Related InterviewSolutions