A sql lab filled with pokemon data

Part 2 556B

123456789101112131415161718192021
  1. # What are all the types of pokemon that a pokemon can have?
  2. SELECT pokemon.types.name
  3. FROM pokemon.types;
  4. # What is the name of the pokemon with id 45?
  5. SELECT pokemon.pokemons.name
  6. FROM pokemon.pokemons
  7. WHERE pokemon.pokemons.id = 45;
  8. # How many pokemon are there?
  9. SELECT COUNT(pokemon.pokemons.id)
  10. FROM pokemon.pokemons;
  11. # How many types are there?
  12. SELECT COUNT(pokemon.types.id)
  13. FROM pokemon.types;
  14. # How many pokemon have a secondary type?
  15. SELECT COUNT(pokemon.pokemons.name)
  16. FROM pokemon.pokemons
  17. WHERE pokemon.pokemons.secondary_type IS NOT NULL;