A sql lab filled with pokemon data

PokemonPart2Answers.sql 439B

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