Skip to content

Instantly share code, notes, and snippets.

@CatTrinket
Last active March 18, 2019 17:44
Show Gist options
  • Save CatTrinket/dd9df57eedfeeb679494ef29918907c8 to your computer and use it in GitHub Desktop.
Save CatTrinket/dd9df57eedfeeb679494ef29918907c8 to your computer and use it in GitHub Desktop.
Counts of how many Pokémon there are of each dual-type combo, as of US/UM; alt forms are counted separately when they have different types, but not double-counted when they have the same type.
count | type | type
-------+----------+----------
26 | normal | flying
14 | grass | poison
14 | flying | bug
12 | poison | bug
10 | water | rock
9 | water | ground
9 | ground | rock
8 | psychic | steel
7 | water | flying
7 | grass | flying
7 | flying | psychic
7 | rock | steel
6 | fire | fighting
6 | fire | flying
6 | water | ice
6 | water | poison
6 | grass | bug
6 | grass | ghost
6 | ground | dragon
6 | flying | dragon
6 | psychic | fairy
6 | bug | steel
5 | normal | fairy
5 | fire | ghost
5 | water | psychic
5 | water | bug
5 | water | dark
5 | grass | fairy
5 | electric | flying
5 | poison | dark
5 | flying | dark
5 | bug | rock
4 | normal | fighting
4 | water | fairy
4 | electric | bug
4 | electric | steel
4 | fighting | psychic
4 | ground | ghost
4 | ground | steel
4 | flying | rock
4 | dragon | dark
3 | normal | psychic
3 | fire | ground
3 | fire | psychic
3 | fire | dragon
3 | fire | dark
3 | water | grass
3 | water | electric
3 | grass | fighting
3 | grass | psychic
3 | grass | dark
3 | grass | steel
3 | electric | rock
3 | ice | ground
3 | fighting | bug
3 | fighting | dark
3 | poison | flying
3 | poison | ghost
3 | ground | flying
3 | ground | dark
3 | flying | ghost
3 | psychic | ghost
3 | psychic | dragon
3 | psychic | dark
3 | ghost | steel
3 | steel | fairy
2 | normal | fire
2 | normal | grass
2 | normal | electric
2 | normal | dark
2 | fire | poison
2 | fire | bug
2 | water | fighting
2 | water | ghost
2 | water | dragon
2 | grass | ice
2 | grass | rock
2 | grass | dragon
2 | electric | dragon
2 | electric | fairy
2 | ice | flying
2 | ice | psychic
2 | ice | rock
2 | ice | dark
2 | ice | steel
2 | fighting | poison
2 | fighting | dragon
2 | fighting | steel
2 | poison | ground
2 | poison | dragon
2 | ground | psychic
2 | ground | bug
2 | flying | steel
2 | flying | fairy
2 | psychic | rock
2 | bug | fairy
2 | rock | dragon
2 | rock | fairy
2 | ghost | dark
2 | dark | steel
1 | normal | water
1 | normal | ground
1 | normal | dragon
1 | fire | water
1 | fire | electric
1 | fire | rock
1 | fire | steel
1 | water | steel
1 | grass | electric
1 | grass | ground
1 | electric | ice
1 | electric | ground
1 | electric | psychic
1 | electric | ghost
1 | ice | fighting
1 | ice | ghost
1 | ice | dragon
1 | ice | fairy
1 | fighting | flying
1 | fighting | rock
1 | fighting | ghost
1 | poison | rock
1 | bug | ghost
1 | rock | dark
1 | ghost | dragon
1 | ghost | fairy
1 | dragon | steel
1 | dragon | fairy
(128 rows)
with counts (count, type_1, type_2) as (
select count(distinct pt1.pokemon_id), pt1.type_id, pt2.type_id
from pokemon_types pt1
join pokemon_types pt2 on
(pt1.pokemon_id, pt1.form_id) = (pt2.pokemon_id, pt2.form_id)
and pt1.type_id < pt2.type_id
where pt1.generation_id = 7 and pt2.generation_id = 7
group by pt1.type_id, pt2.type_id
)
select c.count, t1.identifier "type", t2.identifier "type"
from counts c
join types t1 on c.type_1 = t1.id
join types t2 on c.type_2 = t2.id
order by c.count desc, t1.id asc, t2.id asc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment