Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

How create best schema database with ratings system and available in month?

0

44 views

i will create schema the database MySQL. There are username, password etc and rating system and available in month. Standard it looks like this:

id | username | password | january | february | march     | rating1 | rating2| rating3 |
1  | john     |  xxx     | 1       |  0       | 1         |  3      | 3      | 6
2  | amy      |  xxx     | 1       |  1       | 0         |  1      | 6      | 3

if a user buys article then must add a rating (1,2,3). if chose 2 in John then rating2 +1

id | username | password | january | february | march     | rating1 | rating2| rating3 |
1  | john     |  xxx     | 1       |  0       | 1         |  3      | 4      | 6
2  | amy      |  xxx     | 1       |  1       | 0         |  1      | 6      | 3

january, february (1 - available, 0 - not available)etc set himself John or Amy.

this is good? Should I create separate tables for Januar/feb/march and rating1/2/3? Maybe only for rating?

asked June 25, 2011 7:03 am CDT
posted via StackOverflow

1 Answer

1
 

im not a hard core database designer but at a glance this is schema is not normalized.

if you can create a separate table for month and rating would be better please find the below sample

d | username | password

1 | john | xxx
2 | amy | xxx

id | month | rating

1 | 1 | 3

MonthID | MonthName

1 | January

How ever this sujjestion may not be the ideal solution for your proposed database.

answered June 25, 2011 7:23 am CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions