FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
comp0034_SQL/world_queries.sql at master · UCLComputerScience/comp0034_SQL · GitHub
UCLComputerScience
comp0034_SQL
Repository navigation
Code
Issues
Pull requests
2
(2)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
comp0034_SQL
/
world_queries.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (15 loc) · 803 Bytes
Breadcrumbs
comp0034_SQL
/
world_queries.sql
Copy path
File metadata and controls
15 lines (15 loc) · 803 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
Queries from the lecture slides
*/
SELECT
name, code
FROM
countries;
SELECT
language
FROM
languages;
SELECT DISTINCT
language
FROM
languages;
SELECT
name, population
FROM
cities
WHERE
country_code
=
'
FSM
'
;
SELECT
name, gnp
FROM
countries
WHERE
gnp
>
2000000
;
SELECT
*
FROM
cities
WHERE
country_code
=
'
USA
'
AND
population
>=
2000000
;
SELECT
code, name, population
FROM
countries
WHERE
name
LIKE
'
United%
'
;
SELECT
code, name, population
FROM
countries
WHERE
name
LIKE
'
United%
'
ORDER BY
population;
SELECT
*
FROM
countries
ORDER BY
population
DESC
;
SELECT
*
FROM
countries
ORDER BY
population
DESC
, gnp;
SELECT
name
FROM
cities
WHERE
name
LIKE
'
K%
'
LIMIT
5
;
SELECT
COUNT
(
*
)
FROM
countries;
SELECT
COUNT
(
*
)
AS
total_cust
FROM
countries;
SELECT
continent,
COUNT
(name)
FROM
countries
GROUP BY
continent;
Back
|
FazBrowse Home
|
New Git URL