In class, we're designing a database for course registration. It had 3 attributes for the schedule (days, startTime, endTime) where days was 5 characters to allow for MTWRF.
This would allow classes to be multiple days (albeit at the same time) ie "MW" for a class that meets both on Monday and Wednesday. ie) days:"MW" startTime:"1" endTime:"2"
It turns out that the teacher thought that we just had a single string for the schedule that went something like "M1-2W1-2".
I proposed taking these attributes out into a second table with four fields (classID, day, startTime, endTime) so it would look like:
class:"1" day"M" startTime:"1" endTime:"2"
class:"1" day"W" startTime:"1" endTime:"2"
I was under the assumption to be at least in 1NF that "MW" shouldn't be one value. Am I wrong? Which way is better?
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
He just said thats what he thought we were doing and that it wouldn't break 1NF. Im assuming its because of time restraints and that we arent going to have to query specific schedules...
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks