Table relationship design in mysql -


i little bit confuse table relationships. wish 1 clarify, , tell me going wrong.

i have 3 tables, 1 stores students basic info ---{students_info},the other stores classes---{students_class} , other stores positions ---{students_positions}.

students_info st_id | f_name | l_name 1 | quinoo | mickel 2 | nunoo | gyan 3 | kwanis | nnipa

students_class cl_id | class | academic_year |st_id 13 | | 2013 | 2 32 | b | 2014 | 1 73 | c | 2014 | 3

students_positions pos_id | positions | ushered_year | st_id 54 | president | 2013 | 2 34 | secretary | 2014 | 3

this have done far. friend saw tables , relationships , like, best create table contain ids column values in addition table have, wat suggested

students all_std | st_id | cl_id | pos_id 01 | 1 | 32 | null 02 | 2 | 13 | 54 03 | 3 | 73 | 34

thanks helping.

i don't see what's point of table friend suggested.

the improvement suggest add classes table :

cl_id  | class | academic_year  13     |     | 2013  32     | b     | 2014  73     | c     | 2014  

and students_class link between student , class :

cl_id | st_id 13    |  2 13    |  1 32    |  1 73    |  3 

this way properties of each class stored once in classes table instead of being duplicated in students_class table students share same class.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -