I must develop a database for inputting information of the produced volume (hourly), quality and technical issues during this production. As the input of the production volume is made manually, the user must indicate for each time interval how many parts were produced (for instance from "6 a.m. to 7 a.m."). This time intervals are configured by an ADM user, who also indicates the speed of the production line (time/part) and the pauses programmed during the day. The points I just can't figure out how to do are:

  1. Should I save this time interval at the database, such as "start time:6 a.m. | end time: 7 a.m." ? Or use just like a string "Time interval: 6 a.m. - 7 a.m." ?

  2. When the line has broken down for example at 6:45 a.m. and the problem was solved only at 7:30 a.m., when inputting the production volume from 6-7 a.m. the user must indicate 15 minutes of lost due to line break down, and from 7-8 a.m. 30 minutes of production losses. The problem here is that I must be able to know that both losses were only one event, and not two separated ones.

If anyone have any tip for me, I would really appreciate. :)

Best regards!

  • In response to your flag, this is not really enough information to reopen the question, no. Your question is incredibly vague and doesn't really tell us what the business rules are. You would do better to figure out a spreadsheet layout that accurately reflects what you want to put in the database. Start with data samples, then build a schema. You can't build a schema for something you don't understand. Patterns in software development start from 2-3 use-cases, then we can start to abstract out definitions. That's what you're doing here, abstracting a schema from values. Start with actual data – jcolebrand May 28 '19 at 21:10
  • Start capturing exactly the content you need. Are you using the start/end times to find inclusive events? Are you going to only display it on a report? Is there a standard window where things happen in (6:30-6:30), or is it a thing that starts and goes for X minutes, or is it a thing that you need to capture the data ad-hoc? Do you want to capture the date with it? (Yes) What do you need to write a report? – jcolebrand May 28 '19 at 21:14