Problem Statement : Query a list of CITY names from STATION for cities that have an even ID number.
Print the results in any order, but exclude duplicates from the answer.
The STATION table is described as follows:
Solution :
For this challenge, we must:
Select a unique city column using the Distinct (CITY).
Restrict the selected rows using the WHERE clause so that only records satisfying both of the following two conditions are returned:
ID should be even, Example : 122, 1234, 2346.
Query :
SELECT Distinct(CITY)
FROM STATION
WHERE
(ID%2)= 0;
Output:
Hope you understand !!!
If you have any questions let me know in the comment section.