If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Need some help with database design connections.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-07, 05:44
pagehunter pagehunter is offline
Registered User
 
Join Date: Jul 2007
Posts: 4
Need some help with database design connections.

Hi, first post here.

Need some help regarding my database design. Its not so easy to explain in one post, but I'll try. (Besides my English is poor.)

I will make a system for recording of employees and their schedule of work. I wonder if I'm on the right track here. The thing Im mostly unsure about now is the Schedule table.. Should I connect it to the Exceptions some how instead? I do need to

check if there are any Exceptions on one particular day in the schedule table, if there is, it should say so in the report, otherwise just print the value from the Schedule table..


Reports:
Total work time for each employee from the schedule table including exceptions from the exceptions table, per month.
Total statistics of the different exceptions, (sickness, vacation, over time..and so on.)
What Competences does each employee have?

Useability:
Personal sign/approval on each exception by any supervisor.
Check the Employee list, and if the employee is hired by our - Is he available for work today, or already called in?


If some one could take the time, I would be greatful..
Attached Thumbnails
Need some help with database design connections.-upload.gif  
Attached Files
File Type: zip design.zip (13.9 KB, 31 views)
Reply With Quote
  #2 (permalink)  
Old 07-30-07, 07:06
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the Employee columns fkeyPhoneNumbers and fkeyCompetences are wrong and should be removed

unless you need to know very often which employees share a phone number, the PhoneNumbers table is wrong and should be removed

the table ExceptionTypes is wrong and should be removed
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-30-07, 08:40
pagehunter pagehunter is offline
Registered User
 
Join Date: Jul 2007
Posts: 4
Quote:
Originally Posted by r937
the Employee columns fkeyPhoneNumbers and fkeyCompetences are wrong and should be removed

unless you need to know very often which employees share a phone number, the PhoneNumbers table is wrong and should be removed

the table ExceptionTypes is wrong and should be removed
Ok, tnx for your time,

About the PhoneNumbers table.. I need to add 1 or many phone numbers for 1 employee, how do I manage that?
And every Employee can have 1 or more from a list of competences, and that list must be able to get updated by some admin..
I'll stay there for now, and leave the exceptions problem for later..
Reply With Quote
  #4 (permalink)  
Old 07-30-07, 08:53
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
okay, sorry about the phone numbers table, yes, you are right, it requires a one-to-many relationship

i would use the actual phone number as the key, though

as for the many-to-many EmployeesComptences table, that is also correct, but "fkeyCompetences" in the Employees table is wrong
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 07-30-07, 09:18
pagehunter pagehunter is offline
Registered User
 
Join Date: Jul 2007
Posts: 4
Quote:
Originally Posted by r937
i would use the actual phone number as the key, though
Well, that could work, if there are no couples in the company ..
Quote:
Originally Posted by r937
"fkeyCompetences" in the Employees table is wrong
Ok, any suggestion? What about from pkeyEmployeeID instead?
Reply With Quote
  #6 (permalink)  
Old 07-30-07, 09:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
from pkeyEmployeeID instead?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 07-30-07, 10:29
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Realistically, how many phone numbers can any one employee have?
I know it's not best design practice but if the most an employee could have is 2 then why not just have
Employees(EmployeeID, Name, Telephone, otherTelephone, ... )
__________________
George
Twitter | Blog
Reply With Quote
  #8 (permalink)  
Old 07-30-07, 13:31
pagehunter pagehunter is offline
Registered User
 
Join Date: Jul 2007
Posts: 4
Quote:
Originally Posted by georgev
Realistically, how many phone numbers can any one employee have?
I know it's not best design practice but if the most an employee could have is 2 then why not just have
Employees(EmployeeID, Name, Telephone, otherTelephone, ... )
Ok, I will see how I do that, it's not the biggest of my problems.

What I don't know is how to solve my relations between Exceptions-Employee-Schedule.

Each Employee has got a "fixed" (although editable) schedule. And when there occur some exception (sickness, overtime...) beside the schedule this should be recorded. That's where I'm stuck now.. Some point in right direction?

Last edited by pagehunter; 07-30-07 at 14:17.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On