Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I properly structure my relational mySQL database
    primarykey
    data
    text
    <p>I am making a database that is for employee scheduling. I am, for the first time ever, making a relational mySQL database so that I can efficiently manage all of the data. I have been using the mySQL Workbench program to help me visualize how this is going to go. Here is what I have so far:</p> <p><img src="https://i.stack.imgur.com/1mRNg.png" alt="Mock Up"></p> <p>What I have pictured in my head is that, based on the drawing, I would set the schedule in the <code>schedule</code> table which uses references from the other tables as shown. Then when I need to display this schedule, I would pull everything from the <code>schedule</code> table. Whenever I've worked with a database in the past, it hasn't been of the normalized type, so I would just enter the data into one table and then pull the data out from that one table. Now that I'm tackling a much larger project I am sure that having all of the tables split (normalized) like this is the way to go, but I'm having trouble seeing how everything comes together in the end. I have a feeling it doesn't work the way I have it pictured, @grossvogel pointed out what I believe to be something critical to making this all work and that is to use the <code>join</code> function to pull the data.</p> <p>The reason I started with a relational database was so that if I made a change to (for example) the <code>shift</code> table and instead of record 1 being "AM" I wanted it to be "Morning", it would then automatically change the relevant sections through the <code>cascade</code> option.</p> <p>The reason I'm posting this here is because I am hoping someone can help fill in the blanks and to point me in the right direction so I don't spend a lot of hours only to find out I made a wrong turn at the beginning.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload