Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to normalize it

For each week no we can define maximum 3 time slots, Category id specifies different categories.For each category we have to define 3 times slots for each week.


CSS
Category Id Week No Start Time  End Time
1   1   9:00    1:00
1   1   3:00    5:10
1   1   6:00    7:00
1   2   9:00    1:00
1   2   4:00    5:10
1   2   6:00    7:00
    .
    .
    .
2   1   9:00    1:00
2   1   3:00    5:10
2   1   6:00    7:00
2   2   9:00    1:00
2   2   .   .
Posted

1 solution

I probably would create a table similar to your post but add a timeslot number as a column. The timeslot would be unique when combined with week number and category number. Timeslot would also have a check constraint that the value is between 1 and 3.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900