A sql lab filled with pokemon data

Part2-SimpleSelectAndCounts.txt 501B

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