A sql lab filled with pokemon data

123456789101112131415161718192021222324252627
  1. use pokemon;
  2. #What are all the types of pokemon that a pokemon can have?
  3. SELECT NAME AS "TYPE" FROM types;
  4. #18
  5. #What is the name of the pokemon with id 45?
  6. SELECT ID, NAME
  7. FROM pokemon.pokemons WHERE id IN (45);
  8. # Eevee
  9. #How many pokemon are there?
  10. SELECT COUNT(*) AS "count"
  11. FROM pokemon.pokemons;
  12. #656
  13. #How many types are there?
  14. SELECT COUNT(*)
  15. from pokemon.types;
  16. #18
  17. #How many pokemon have a secondary type?
  18. SELECT pokemons.secondary_type
  19. from pokemon.pokemons
  20. where pokemons.secondary_type IS NOT NULL;
  21. #316