Stop coding till you've done these steps ...
1 read about how relational databases work, eg
http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch01.html
2 read about how to develop a requirements document, eg
http://www.artfulsoftware.com/dbdesignbasics.html
3 follow a method like that described in #2 till you have a database that
you have proved meets that requirement
A few comments specifically about your question. Shift patterns aren't written in stone, can be almost guaranteed to change over time, so you probably need ...
- an employees table employees(eid pk, firstname, lastname, ...) populated with all employee names
- a calendar table eg calendar(date) populated, say, for the next couple of years
- a generalised shifts table allowing any imaginable shift pattern over any 24 hr period eg shifts(sid pk, shiftname, timestart time, timestop time, ...)
- a bridge table in which one row assigns one time period on one day to one employee eg empshifts( shid ph, sid references shifts(sid), eid references employees(eid), ... )
Edited 1 time(s). Last edit at 09/30/2018 04:09PM by Peter Brawley.