1.

Find all the tuples having a 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’ temperatureThe question was asked during an interview.My enquiry is from Basic SQL topic in division Laying the Foundation of SQL Server

Answer»

The correct answer is (a) SELECT * FROM WEATHER WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’

To elaborate: Subquery—also REFERRED to as an inner query or inner select—is a SELECT STATEMENT embedded within a DATA manipulation LANGUAGE (DML) statement or nested within another subquery.



Discussion

No Comment Found

Related InterviewSolutions