Thread: Design confusion
02-09-13, 11:06 #1Registered User
- Join Date
- Nov 2012
Hey guys, I'm making a website and I have an option to define your availability throughout the week, however I need a database table to store this information, I have been thinking long and hard about how I might do this and I can't come to a decision (or convince myself its the easiest way!)
Basically, for each day, monday through sunday, a user can set if they are available, at earliest time, until latest time, and then three locations at which they may be available.
I have it figured that I will need these columns at least:
Location 1 (Varchar)
Location 2 (Varchar)
Location 3 (Varchar)
now how do I link this to both the user AND the day.. DO i add a column foreign key for UserID from my user table and then make 7 seperate tables, one for each day of the week or do I have one table with 6 columns*7(days of the week) plus user id... I have no idea what the best way to do this is or if I am missing something,I am relatively new to this. Thanks!
02-09-13, 12:00 #2Resident Curmudgeon
- Join Date
- Feb 2004
- In front of the computer
I'd add a user identifier and a day identifier to your existing table.
-PatPIn theory, theory and practice are identical. In practice, theory and practice are unrelated.