mysql - SQL: Designing tables for storing agendas/schedule -
i'm trying create weekly (monday - sunday) schedule/agenda, similar google calendar, using mysql users able fill out , display schedule tasks have @ day during hour interval. example user task store in schedule
username | day | time | task
jimbob, tuesday, 13:00, eat super delicious spaghetti.
i'm wondering best way design tables?
i create table every day of week, or have 1 big table store info day of week. if have million users, 1 big table performance issue?
also, field of tables planning make 1 row store 1 task each hour, store tasks each hour of day. latter result in lot of null values , take more memory, if users fill out lot of calendar seems reduce lot of rows, , redundant username entries. makes easier print out schedule. thoughts?
username | hour | task|
or
username | 12am |task1 | 1am | task2 | 2am ....
thanks.
the best way this, imo, have 2 tables: 1 users , 1 tasks.
users have user id, username plus whatever else.
tasks have date , time, description of task, task id , user id of user task is. shouldn't make table storing each day of week since can query dates of tasks. how should design tables. actual calendar , queries should done in php or whatever want use it.
Comments
Post a Comment