Browse Source

Started final report

mpierse 5 years ago
parent
commit
dd717478df
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      Queries

+ 11
- 3
Queries View File

@@ -64,8 +64,16 @@ GROUP BY pt.pokemon_id
64 64
 HAVING COUNT(*)=1
65 65
     ) AS once;
66 66
 
67
-SELECT pokemons.name, trainers.trainername, pokemon_trainer.pokelevel, , pokemons.secondary_type
68
-FROM pokemons
69
-JOIN
67
+/*Final Report*/
68
+SELECT p.name as Name, tr.trainername as Trainer, pt.pokelevel as Level, t.name AS PrimaryType, t.name AS SecondaryType
69
+FROM types t
70
+JOIN pokemons p
71
+ON t.id=p.primary_type
72
+JOIN pokemons s
73
+ON t.id=s.secondary_type
74
+JOIN pokemon_trainer pt
75
+ON p.id=pt.pokemon_id
76
+JOIN trainers tr
77
+ON pt.trainerID=tr.trainerID;
70 78
 
71 79