2013-12-11 67 views
0

我正在創建遊戲評論數據庫。我是新來的,但我正在盡我所能。關於數據庫的一點點:系統很簡單,用戶填寫php表單,在其中插入他的名字,選擇反饋之間的電子郵件是好是壞,並​​留下評論/建議。我加入的照片它的外觀在視覺上,我對外部鏈接很遺憾,我不能在這裏上傳:Visual database正常化:它做得好嗎?

因此,這裏是我的表,這個過程中我通過標準化如何去:

(I believe this is 1NF, correct me if I am wrong) 

Table_review { 
    User ID 
    User name 
    User email 
    Feedback 
    Comment 
}  


(I believe this is 2NF, correct me if I am wrong) 

Table_user { 
    User ID 
    User name 
    User email 
    Comment 
} 

Table_review { 
    Feedback ID 
    Feedback 
} 

(I believe this is 3NF, correct me if I am wrong) 

Table_user { 
    User ID 
    User name 
    User email 
    Comment 
} 

Table_review { 
    Feedback ID 
    Feedback 
} 

Table_user { 
    User ID 
    User name 
    User email 
    Comment 
} 

Table_whole { 
    User ID 
    Feedback ID 
} 

我的問題:

是否正常化?

「Table_whole」是否應包含自己的ID?

我說謝謝您的幫助,因爲我真的沒有時間了..

+1

這個問題似乎是題外話,因爲它是一個代碼審查請求。這更適合http://codereview.stackexchange.com –

+0

好的,謝謝,我會解決它! –

+0

@JohnConde:問題中沒有代碼。 –

回答

0
-- The user can make as many comments as they like 
Table_review { 
    User ID 
    Game ID 
    Feedback ID 
}  

Table_feedback { 
    Feedback ID 
    Comments 
    TimeStamp 
} 

-- Now users can comment on what other users think 
-- but only to one level of nesting 
Table_feedback_comments { 
    Feedback ID 
    User ID 
    Comment 
    TimeStamp 
} 

-- a user can only rate a game once, but they can change their rating over time 
-- For example more content was added and the user likes this 
-- and wants to reflect that in their rating 
Table_rating { 
    Game ID 
    User ID 
    Rating 
} 

Table_user { 
    User ID 
    User name 
    User email 
    Comment -- something that describes the user 
} 

-- Even if you have only one game you can still store it in the database 
Table_game { 
    Game ID 
    Game Name 
    -- other columns used to represent a game 
} 
+0

事情是遊戲只是一個。其應用促銷網站,用戶填寫他們的意見/評論。作爲最低要求,我需要三個關係實體。如果我將日期存入數據庫將會如何? –

+0

你是什麼意思「遊戲只是一個」你的意思是隻有一個遊戲? – robbmj

+0

是的,Android手機只有一款遊戲。所以人們來到這個網站,他們可以回顧這個遊戲。 –

相關問題