forked from kristofer/PokemonSqlLab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpart2.sql
More file actions
25 lines (21 loc) · 646 Bytes
/
part2.sql
File metadata and controls
25 lines (21 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Question: What are all the types of pokemon that a pokemon can have?
# Answer: Normal, Water, Grass, Rock, Fire, Ground, Poison, Bug, Electric, Dragon, Steel, Dark, Fighting, Psychic, Ghost, Fairy, Ice, Flying
SELECT GROUP_CONCAT(' ', name)
FROM types;
# Question: What is the name of the pokemon with id 45?
# Answer: Eevee
SELECT name
FROM pokemons
WHERE id = 45;
# Question: How many pokemon are there?
# Answer: 656
SELECT COUNT(1)
FROM pokemons;
# Question: How many types are there?
# Answer: 18
SELECT COUNT(1)
FROM types;
# Question: How many pokemon have a secondary type?
# Answer: 316
SELECT COUNT(secondary_type)
FROM pokemons;