Reputation: 6050
I am working on a project similar to Google calendar. To create it I am using ASP.NET. I would like users to have the ability to populate their own calendar entries, and then to crosscheck against other users calendar entries in order to check ideal times that meetings can be made.
I'm not sure what would be the best way to represent this in a database, however.
I have a table for users storing their name, id, password. I understand this and why/how to create it.
So I want to have a table for a users calendar - thinking about it, I would guess that the best way to do this would be to have one table consisting of the users id - but then what represents every hour of the users day? If I want to populate a database for, let's say, 3 years in advance of todays day. It is not practical to query a single database with a primary key identifying the user and a separate column for every day or even hour (let alone 15 minutes!).
What is the best way to do this? If you need elaboration please ask, I have tried to explain the problem as clearly as I can, but it is difficult not to be a tad ambiguous when discussing such a complex problem.
Upvotes: 0
Views: 157
Reputation: 49803
You would only store events, stored by their start and end (or start and duration). You fill in the table of time slots programmatically. Day/times that don't have an event overlapping them are empty.
Upvotes: 1