473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Entity Relationship Question

166 100+
Hello:

I am building something to keep track of vacation time per department per employee.

The way we keep track of it is a department will get 4 hours every 30 days they go with out an incident. If any one employee has an incident with in this 30 days, all of the employees in the department lose the 4 hours for the current month, as well as the following month.

I am wondering who the relationship belongs to:
A department earns vacation time
or
An employee earns vacation time

I need to keep track of how much vacation each employee has incurred.
I would appreciate any input.
Feb 16 '09 #1
4 1145
Stewart Ross
2,545 Expert Mod 2GB
Hi. Since the gain or loss of entitlement is at employee level it should be clear that the entity involved is employee, with the dept grouping involved in implementing the business rule for all employees if any one transgresses.

The employees are entitled to the leave, not the dept. As applied in this case a dept is an administrative grouping which links a subset of the company's employees to a specific business unit. The business rule you quote just appears to mean that if an incident occurs the employees in that grouping lose their entitlement.

-Stewart
Feb 16 '09 #2
beacon
579 512MB
I'm bad at relationships (haha, I made a pun), but here's my two cents:

If an employee can only belong to one department and everyone in the department earns vacation time when there isn't an incident, it would seem to me that there would be a 1:many relationship between Department and Employee and another 1:many relationship between Employee and Vacation time.

After setting up the tables, you could query the amount of time for each employee or for the department (of employees) as a whole.

Does that make sense?
Feb 16 '09 #3
csolomon
166 100+
Yes, that makes sense.

(I often find it helpful to talk out the relationship problem before I decide on what the relationship is)

Thanks to you both!
Feb 16 '09 #4
beacon
579 512MB
I'm glad you did...it helps me out too. I like to think of it as mind aerobics!
Feb 16 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike Sutton | last post by:
Please let me know what you think of this scheme I have come up with (not to imply that noone else has before me) for managing relationships. I have created an entities table with Individual and...
1
by: David Madore | last post by:
Hi! Anyone in for a Byzantine discussion on XML well-formedness? Here's the situation: test.xml contains --- test.xml: cut after --- <?xml version="1.0" encoding="us-ascii"?> <!DOCTYPE...
11
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you...
4
by: Ian Rutgers | last post by:
If I am using an DTD in an xml file I know to declare an entity I would enter; <!DOCTYPE letter > How and where would I declare the entity? (Sorry for the silly question) Thank you,
2
by: Balaji | last post by:
Hi I have three database tables - Location, Part and Detail. Location and Part have a one-many relationship to detail. Location and Part need to be inserted into the database before inserting a...
2
by: Emily Jones | last post by:
That subject line will have Joe Celko apoplectic!! Let's say I have this thing. Oh, I don't know, a car. No, a vehicle. Can we agree that is an entity type? Some attributes might be VIN, Fuel,...
11
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to...
6
by: Tuomas Rannikko | last post by:
Hello, I'm currently writing a XML processor for the fun of it. There is something I don't understand in the spec though. I'm obviously missing something important. The spec states that both...
3
by: chris.kennedy | last post by:
I am really struggling to create an entity which maps to 2 "base" entities. I have a customer and invoice entity which are based in tables in a one to many relationship. I have tried: 1....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.