SELECT (SELECT COUNT(CITY) FROM STATION) - (SELECT COUNT(DISTINCT CITY) FROM STATION)
select city, length(city) from station order by length(city) asc, city limit 1; select city, length(city) from station order by length(city) desc, city limit 1;
select distinct city from station where REGEXP_LIKE(city,'^[AEIOU]');
select CITY from STATION where right(lower(CITY),1) in ('a','e','i','o','u') group by CITY;
right() work for select character from right side. and lower() make string into lower case
SELECT DISTINCT city FROM station WHERE city RLIKE '^[aeiouAEIOU].*[aeiouAEIOU]$';
SELECT DISTINCT city FROM station WHERE NOT REGEXP_LIKE(city,'^[AEIOU]');
Use WHERE NOT
select CITY from STATION where NOT right(lower(CITY),1) in ('a','e','i','o','u') group by CITY;
Use WHERE NOT
SELECT DISTINCT city FROM station WHERE NOT city RLIKE '^[aeiouAEIOU].*[aeiouAEIOU]$';
Use WHERE NOT
select distinct CITY from STATION where CITY NOT RLIKE '^[aeiouAEIOU]' AND CITY NOT RLIKE '[AEIOUaeiou]$' GROUP BY CITY;