Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70oF.
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70oF. Correct Answer SELECT city, temperature, condition FROM weather WHERE condition = 'sunny' OR condition = 'cloudy' AND temperature > 70;
This SQL query is used to retrieve the names of cities along with their temperature and condition, but with specific conditions:1. WHERE condition = 'sunny' OR condition = 'cloudy': This part of the query specifies that the "condition" in the "weather" table should be either "sunny" or "cloudy." Using the OR operator, it allows the condition to match either of these values.
2. AND temperature > 70: After specifying the condition, this part of the query checks that the temperature is greater than 70°F. The AND operator is used to ensure that this temperature condition is met in addition to the "sunny" or "cloudy" condition.
By combining these conditions, Option C correctly finds cities where the condition is either "sunny" or "cloudy" and the temperature exceeds 70°F. This results in a list of cities that meet both of these criteria.
মোঃ আরিফুল ইসলাম
Feb 20, 2025