Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Design confusion

$
0
0
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:

Available (Bool)
From (Time)
Until (Time)
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!

Viewing all articles
Browse latest Browse all 13329

Trending Articles