Find the names of the countries whose condition is sunny.
A. SELECT country FROM location WHERE condition = 'sunny';
B. SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = 'sunny');
C. SELECT country FROM location WHERE city NOT IN (SELECT city FROM weather WHERE condition = 'sunny');
D. SELECT country FROM location WHERE city UNION (SELECT city FROM weather WHERE condition = 'sunny');
Answer: Option B
Solution(By Examveda Team)
To find the names of countries where the condition is "sunny," you should use the SQL query SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = 'sunny'); (Option B). This query correctly uses a subquery to first select the cities with a "sunny" condition from the "weather" table and then matches those cities to the "city" column in the "location" table to determine the corresponding countries. Option B is the appropriate choice for obtaining the desired result.Join The Discussion
Comments ( 11 )
A. Structured Query Language
B. Structured Query List
C. Simple Query Language
D. None of these
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
A. Data Definition Language(DDL)
B. Data Manipulation Language(DML)
C. Both of above
D. None
Which operator performs pattern matching?
A. BETWEEN operator
B. LIKE operator
C. EXISTS operator
D. None of these
What operator tests column for the absence of data?
A. EXISTS operator
B. NOT operator
C. IS NULL operator
D. None of these
option A is correct because city is not mention in question
Option A is also valid...
You just replace City with country in syntax, simple.
option A is also valid because it wasn't mentioned in the question that the 'condition' column is existed in another table!
option A is also valid because it wasn't mentioned in the question that the 'condition' column is existed in another table!
Option B is invalid as the question asks for the names of all the countries, not cities
option A is also valid as city is not mentioned any where in the question.
option A is all valid as city is not mentioned any where in the question.
The option b is the wrong answer because the in this condition written as = sunny'
Here it is no specified that the condition can be found from cities only. Hence the first option is simple and correct in my opinion.
i think option one is right bcoz the query says the country condition should be sunny ..it doesn't ask to check for city condition..
or on the other way aroud i think this is an ambiguous query.