0
我剛開始嘗試表關係和連接查詢。連接3個表的SQL查詢
我有3個表格:people
,course
, bridge
。
我想要做的是,能夠選擇一個student
,並得到什麼他所有的course_names
其出席,如果他是一個學生:像
SELECT(.......) where student_name = 'what I want'.
我沒有要發佈的代碼在這裏,因爲我所嘗試的一切都是一團糟。
people
:
people_id student_name
1 Alice
2 Bob
3 Caroline
4 David
5 Emma
course
:
course_id course_name
1 IT
2 art
3 sports
4 math
5 whatever
bridge
:
people_id course_id people_role
1 1 student
1 3 student
1 5 student
2 1 student
2 2 student
2 5 student
4 1 teacher
開始與代碼的結果。它有助於顯示你出錯的地方 – 2015-04-04 13:01:05