A sql lab filled with pokemon data

12345678910111213141516
  1. ## PART 2: SIMPLE SELECTS AND COUNTS
  2. # What are all the types of pokemon that a pokemon can have?
  3. SELECT name as "Types" FROM types;
  4. # What is the name of the pokemon with id 45?
  5. SELECT pokemons.id as "ID", name as "Name" FROM pokemons WHERE id = 45;
  6. # How many pokemon are there?
  7. SELECT COUNT(name) as "NumSpecies" FROM pokemons;
  8. # How many types are there?
  9. SELECT COUNT(name) "NumTypes" FROM types;
  10. # How many pokemon have a secondary type?
  11. SELECT COUNT(secondary_type) "NumSecondType" FROM pokemons;