原帖由 thinkpanda 於 2008-11-24 10:29 發表 
score table 有member id 嘛, 咁就可以搵到個member name.
搵分數唔係靠member name, 而係靠member id.
如果你唔係有好多項目, 總分用sql 加埋score 就得, 不需另設total.
SQL 點寫你就要自己睇下書啦.
讓我重新整理下
member (id, username, pw) - 注冊會員
app (id, match_id ,member_id, name) - 報名
match (id, name) - 比賽名
match_item (id, match_id, name) - 評分項目
score (id, "app_id"? ,match_item_id, score) - 項目評分
死啦,唔明tim
e+ match_item 同 score 係1對1?
member (id, username, pw) (1 , pwct , pw)
app (id, match_id ,member_id, name) (1 ,1, 1,pwct)
match (id, name) ( 1, test)
match_item (id, match_id, name) ( 1 , 1, a) ( 2 , 1, a)
score (id, "app_id"?,match_item_id, score) (1 ,1, 1, 70 ) (1 ,1, 2, 50 )
then
pwct係比賽test 係a項目 = 70分?
pwct係比賽test 係b項目 = 50分?
咁樣?
咁score 咪都要加match_id 唔係點知邊個參加者參加邊項比賽?
[ 本帖最後由 pwct 於 2008-11-24 11:04 編輯 ] |