Home > Enterprise >  SQL data normalisation for Calendar entry
SQL data normalisation for Calendar entry

Time:07-25

I am working on a project that needs calendar entries to create reminders for the users. I am storing the id, title, description, date, and time of each entry in a relational database.

Does it mess up data normalization by storing the start Date & Time together and end Date & time together or would it be best to separate them as so: startDate, endDate, startTime, endTime? As the first option would be more efficient in retrieving the events from the database to load on the front end.

CodePudding user response:

My choice would always be to store date and time together in a DATETIME column. Makes it far easier to search time ranges.

There's one possible exception: calendar entries that repeat at the same time. But solving that general problem is notoriously hard and beyond the scope of a Stack Overflow answer.

  • Related