소스 검색

Started final report

mpierse 6 년 전
부모
커밋
dd717478df
1개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 11
    3
      Queries

+ 11
- 3
Queries 파일 보기

@@ -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