mysql - Dilemma about the number of columns on a table -
scenario:
creating website checklist, can done/accessed multiple users in same time needs fields editable, saveable , retrievable.
dilemma:
checklist has 212 entries, means 212 rows. have 5 columns needs entries thus, 212x5. means, have create 1060 columns able me code website want do. 1060 columns on table seems wrong , tiring use.
sample solution:
divide 5 columns 5 tables, making date checklist created primary key. use 5 tables corresponding columns reducing number of columns per table 212.
is there anyway reduce this? sorry long post, appreciated.
**edit: reason, can't comment on answers, says error on page. nevertheless, appreciate everybody's answer; yet have 1 info may change answers. have thought of making 5 columns instead of obnoxious 1060, doing that, need/the system need create 1 table per 1 worksheet , of course, on time, cause massive problems database.
although still pretty huge, ah_hau's answer seems smallest , easiest handle. using it, system create 217 entries per checklist, use 6-8 columns only. thank shed light dillemma, hope see guys again on next question. cheers!
why not directly add 1 more column in checklist table?
your table structure should like
- userid
- entryid (value 1-212)
- col1_entry
- col2_entry
- col3_entry
- col4_entry
- col5_entry
Comments
Post a Comment