Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. Input Format The STATION table is described as follows:

SELECT DISTINCT(CITY) FROM STATION WHERE CITY LIKE '%a' OR CITY LIKE '%e' OR CITY LIKE '%i' OR CITY LIKE '%o' 
OR CITY LIKE '%u';       
Comment

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

SELECT DISTINCT CITY
FROM STATION 
WHERE REGEXP_LIKE(CITY, '^[aeiouAEIOU]')
ORDER BY CITY
Comment

Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.

SELECT DISTINCT city FROM station WHERE city RLIKE '[aeiouAEIOU]$';
Comment

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[aeiou]';
Comment

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

select distinct city from station where city substr(city,1,1) in ('a','e','i','o','u');
Comment

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

SELECT DISTINCT 
CITY 
FROM STATION 
WHERE lower(substr(CITY,1,1)) in ('a','e','i','o','u') ;
Comment

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

SELECT DISTINCT city FROM station 
GROUP BY city HAVING LEFT(city, 1) IN ("a", "e", "i", "o", "u");
Comment

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

SELECT DISTINCT city FROM station WHERE city RLIKE '^[aeiou]';
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server alter table column nullable 
Sql :: show table columns mysql command line 
Sql :: how to increase size of column in sql 
Sql :: mac xampp mysql not starting 
Sql :: oracle to_timestamp 
Sql :: mysql add boolean column 
Sql :: install mysql on mac 
Sql :: log queries postgre 
Sql :: sqlite rename column 
Sql :: sql add date hour 
Sql :: Mysql query add column with default string value 
Sql :: Row Number is sql server 
Sql :: postgres set sequence value to max id 
Sql :: postgres install unaccent extension 
Sql :: tsql get beginning of year 
Sql :: mysql timestamp in laravel migration 
Sql :: how to rename table in sql 
Sql :: cast to date bigquery 
Sql :: search for tables with name postgresql 
Sql :: how to update an attribute in MySQL 
Sql :: postgres extract number from string 
Sql :: mysql get yesterday 
Sql :: mysql date diff in seconds 
Sql :: ifnull postgres 
Sql :: how to give access to database in postgresql server to another user 
Sql :: check sql database table lock 
Sql :: nvl postgres 
Sql :: sql copy table 
Sql :: How to select the nth row in a SQL database table? 
Sql :: sql server user permissions and roles 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =