2 Replies - 887 Views - Last Post: 21 April 2013 - 08:51 PM

#1 red_4900  Icon User is offline

  • Code T(h)inkers
  • member icon

Reputation: 21
  • View blog
  • Posts: 1,120
  • Joined: 22-February 08

How best to design relations?

Posted 20 April 2013 - 08:05 AM

Hello guys,

So I have this problem.

14 days exhibition, 5 workers. Every day will have 3 workers. Every worker can work max 9 days in 14 days period. Each worker has his own daily cost, and days that he can't work at all. (example : For WorkerA, his daily cost for the whole 14 days is : 1-1-2-3-1-1-x-1-x-4-1-1-1-1, whereas for WorkerB, it's 1-2-3-1-1-4-1-1-1-1-x-4-x-1)

How do I design this relations? I am very beginner in designing for database, so I'm struggling now for my first step. Hint please?

The table would be something like this?
_______________________________
WorkerID || Day || Cost || Allowed ||
-------------------------------------

This post has been edited by red_4900: 20 April 2013 - 08:07 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How best to design relations?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9277
  • View blog
  • Posts: 34,788
  • Joined: 12-June 08

Re: How best to design relations?

Posted 20 April 2013 - 09:27 AM

You would have a table of workers, a table of exhibition, and a table matching up entries of workers to exhibitions (and I guess the cost of said worker working the exhibition).

The rest of the constraints (how many days in a row, how many per day, etc) are all extra constraints outside the concern of the database.. the db is just there to hold your data.. any sort of meta constraints is on the program using said data.
Was This Post Helpful? 2
  • +
  • -

#3 red_4900  Icon User is offline

  • Code T(h)inkers
  • member icon

Reputation: 21
  • View blog
  • Posts: 1,120
  • Joined: 22-February 08

Re: How best to design relations?

Posted 21 April 2013 - 08:51 PM

Hey, this part: 'outside the concern of the database' really made me look into database design in the right perspective. Made me re-think what is actually needed by the db.

Thank you very much! :D

This post has been edited by red_4900: 21 April 2013 - 08:52 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1