| 123456789101112131415 |
- /*Final Report
- Directions: Write a query that returns the following collumns:
-
- | Pokemon Name | Trainer Name | Level | Primary Type | Secondary Type |
- |:------------:|:------------:|:-----:|:------------:|:--------------:|
- | Pokemon's name| Trainer's name| Current Level| Primary Type Name| Secondary Type Name|
-
- Sort the data by finding out which trainer has the strongest pokemon so that this will act as a ranking of strongest to weakest trainer. You may interpret strongest in whatever way you want, but you will have to explain your decision.
- */
-
- SELECT p.name, t.trainername, tr.pokelevel, p.primary_type, p.secondary_type
- FROM pokemon.pokemons p
- JOIN pokemon.pokemon_trainer tr
- JOIN pokemon.trainers t ON p.id = tr.pokemon_id AND t.trainerID = tr.trainerID
- ORDER BY tr.pokelevel DESC;
|