Gen 4 Gen 3 Gen 6 Minecraft

testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing

Base stat formula: Stat = floor(floor((2 * B + I + E) * L / 100 + 5) * N)
For HP: Stat = floor((2 * B + I + E) * L / 100 + L + 10)

B = Base stat
I = IV
E = EV
L = Level
N = Nature

stat / 1.8 = stat width

SELECT ps.name, ps.pokemon_species_id, ps.evolves_pokemon_species_id, ps.position, pe.minimum_level FROM pokemon_species AS ps INNER JOIN pokemon_evolution AS pe USING(pokemon_species_id) WHERE ps.evolution_chain_id=(SELECT evolution_chain_id FROM pokemon_species WHERE pokemon_species_id=126) AND ps.generation_id<=4 ORDER BY ps.position

SELECT ps.name, ps.pokemon_species_id, (SELECT type_id FROM pokemon_types WHERE pokemon_id=1 AND slot=1), (SELECT type_id FROM pokemon_types WHERE pokemon_id=1 AND slot=2) FROM pokemon_species AS ps INNER JOIN pokemon_dex_numbers AS pdn USING(pokemon_species_id) WHERE pdn.pokedex_id=1 AND ps.generation_id=2

THE ONE! 4 HOURS! | SELECT ps.name, ps.pokemon_species_id, pt1.type_id, (CASE WHEN pt2.type_id!=pt1.type_id THEN pt2.type_id END) FROM pokemon_species AS ps INNER JOIN pokemon_dex_numbers AS pdn USING(pokemon_species_id) INNER JOIN pokemon_types AS pt1 ON pdn.pokemon_species_id=pt1.pokemon_id INNER JOIN pokemon_types AS pt2 ON pt1.pokemon_id=pt2.pokemon_id INNER JOIN pokemon_types AS pt3 ON pt1.pokemon_type_id=pt3.pokemon_type_id-1 WHERE pdn.pokedex_id=1 AND ps.generation_id<=6 AND pt1.slot=1 AND (CASE WHEN pt3.pokemon_id=pt1.pokemon_id THEN pt2.slot=2 ELSE pt2.slot=1 END)