MySQL Forums
Forum List  »  Newbie

Re: Trying to learn the right way
Posted by: Peter Brawley
Date: September 30, 2018 04:09PM

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.

Options: ReplyQuote


Subject
Written By
Posted
September 30, 2018 03:20PM
Re: Trying to learn the right way
September 30, 2018 04:09PM
September 30, 2018 06:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.