Ad Code

Responsive Advertisement

Uri - Beecrowd | 2607 | Providers' City in Alphabetical Order

beecrowd | 2607

Providers' City in Alphabetical Order

Paulo R. Rodegheri BR Brazil


Every month the company asks for a report from the cities that providers are registered. So, do a query that returns all the cities of the providers, but in alphabetical order.

OBS: You must not show repeated cities.

Schema

providers
ColumnType
id (PK)numeric
namevarchar
streetvarchar
cityvarchar
statechar

Tables

providers
idnamestreetcitystate
1HenriqueAv BrasilRio de JaneiroRJ
2Marcelo AugustoRua ImigrantesBelo HorizonteMG
3Caroline SilvaAv São PauloSalvadorBA
4Guilerme StaffRua CentralPorto AlegreRS
5Isabela MoraesAv Juiz GrandeCuritibaPR
6Francisco AccerrAv PaulistaSão PauloSP

Output Sample

city
Belo Horizonte
Curitiba
Porto Alegre
Rio de Janeiro
Salvador
São Paulo


N.B.: It's better if you solve this by your own. Thank you!


  URI - BEECROWD Online Judge 2607 Solve in SQL:                                          

-- Solved by Intesar
SELECT distinct city
FROM providers;


Post a Comment

0 Comments

Ad Code

Responsive Advertisement