Home » Developer & Programmer » Designer » I took an example ERD,but ask if what I found in it there is a flaw
I took an example ERD,but ask if what I found in it there is a flaw [message #548531] Thu, 22 March 2012 12:47 Go to next message
brunobiondo
Messages: 6
Registered: November 2009
Location: Italy
Junior Member
Hi,
I took an example ERD image used as a reference,it's a class diagram modeling a simple entities relationship for a supermarket pay database.
I ask if what I found in it there is a flaw. Include the original version image file, and the one amended from me,with indication of what I think is a flaw.

Any comment would be appreciated.
Thanks
./fa/9984/0/
Re: I took an example ERD,but ask if what I found in it there is a flaw [message #548545 is a reply to message #548531] Thu, 22 March 2012 15:13 Go to previous messageGo to next message
Littlefoot
Messages: 19689
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
At least half of your explanation is missing.
Re: I took an example ERD,but ask if what I found in it there is a flaw [message #548634 is a reply to message #548545] Fri, 23 March 2012 12:14 Go to previous messageGo to next message
brunobiondo
Messages: 6
Registered: November 2009
Location: Italy
Junior Member
./fa/9990/0/Littlefoot wrote on Thu, 22 March 2012 21:13
At least half of your explanation is missing.

Ok Littlefoot, I updated my question above,and added more information.

[Updated on: Fri, 23 March 2012 12:22]

Report message to a moderator

Re: I took an example ERD,but ask if what I found in it there is a flaw [message #548652 is a reply to message #548634] Fri, 23 March 2012 15:23 Go to previous messageGo to next message
Barbara Boehmer
Messages: 7995
Registered: November 2002
Location: California, USA
Senior Member
It depends on the business rules. So, you need to find out what those are before you can decide. You have already noted the issues, so you just need to get your questions answered.

If the shifts table tracks shifts worked over time and the employee can change departments and the users table only shows the current department, then the original is correct.

If an employee can only ever belong to one department or multiple rows per department are allowed for each employee in the users table, and you want to enforce that in your shifts table, then your modification is correct. Note that you will need a composite foreign key that includes both department_id and user_id in the shifts table and a primary key or unique index on the id and department_id columns in the users table.
Re: I took an example ERD,but ask if what I found in it there is a flaw [message #548791 is a reply to message #548652] Mon, 26 March 2012 05:17 Go to previous messageGo to next message
brunobiondo
Messages: 6
Registered: November 2009
Location: Italy
Junior Member
Thank you Barbara.
I want also to point out that, if I wanted to model the architecture as per my modifications (composite foreign key relationship between Shitfs and Users table), and if I'm interested in tracking shifts worked over time in the shifts table, I'm still able to do so.

[Updated on: Mon, 26 March 2012 05:21]

Report message to a moderator

Re: I took an example ERD,but ask if what I found in it there is a flaw [message #549325 is a reply to message #548634] Thu, 29 March 2012 08:53 Go to previous messageGo to next message
brunobiondo
Messages: 6
Registered: November 2009
Location: Italy
Junior Member
Just update with final revision of image.No need to reply, question has been answered.
Thank you

./fa/10013/0/
Re: I took an example ERD,but ask if what I found in it there is a flaw [message #552865 is a reply to message #549325] Sun, 29 April 2012 14:38 Go to previous messageGo to next message
sicinthemind
Messages: 1
Registered: April 2012
Location: Tampa, FL
Junior Member
I have no disagreement from the original

Thats a One-to-Many relationship from Departments.Department_Id(primary key)

Departments.id(pkey) -> Shifts.department_id(fkey)
Departments.id(pkey) -> Users.department_id(fkey)

[Updated on: Sun, 29 April 2012 14:39]

Report message to a moderator

Re: I took an example ERD,but ask if what I found in it there is a flaw [message #585474 is a reply to message #549325] Sun, 26 May 2013 03:57 Go to previous message
fathiesam
Messages: 5
Registered: October 2009
Junior Member
hi i need an er diagram for a supermarket and i collect ERs to have a look on ideas i would like to have a look on your ER can i ?
my e-mail is fathiesam@yahoo.com

[Updated on: Sun, 26 May 2013 03:58]

Report message to a moderator

Previous Topic: Fact Table Design
Next Topic: Convert relational model diagram into image format using sql developer data modeler
Goto Forum:
  


Current Time: Wed Oct 22 19:13:11 CDT 2014

Total time taken to generate the page: 0.15029 seconds