In my scheduling database, I have an “assignments” table with the following fields:
| assignment_date | start_time | end_time | task_ID | staff_ID |
Each staff member will have six or seven separate assignments per day, meaning that with the current staff numbers there will be approxmiately 250 individual entries for any individual date.
I was wondering if there are any situations where it would be worth extracting the date field into a separate table ( i.e. changing assignment_date to assignment_date_ID ).
Is this taking normalisation a step too far? I can imagine that it would make queries a fair bit more complex, but can you think of any advantages to this structure that would offset the extra complexity?
Replacing dates (or text, or anything else, for that matter) with an ID number has absolutely nothing to do with normalization. Hunt down whoever taught you that idea, and poke them in the eye with a sharp stick.
If you want to restrict the range of acceptable dates, you can use a foreign key to a table of acceptable dates. That’s a good reason to add a table; it, too, has absolutely nothing to do with normalization (it has to do with data integrity); and you shouldn’t put an id number in that table, either.