Results 1 to 5 of 5
  1. #1
    Paullhk is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2014
    Posts
    2

    Enquire Access table design and define relationship.

    Hi Experts,

    I am doing my assignment for my database implementation subject. I am now encountered the relationships between the table Employee and the table Department.

    Using SQL to create required tables, fields and relationships as belows:-

    Table 1: EMPLOYEE (EmpID_PK, EmpName, DoB, Address, Gender, Salary, SupervisorID, DeptNo_FK)
    Table 2: DEPARTMENT (DeptNo_PK, DeptName, ManagerID_FK, ManagerStartDate)
    Table 3: DEPT_LOCATION (DeptNo_FK, DeptLocation)
    Table 4: PROJECT (ProjNo_PK, ProjName, ProjLocation, DeptNo_FK)
    Table 5: WORKS_ON (EmpID_FK, ProjNo_FK, Hours)

    [Note: Primary key is _PK, Foreign key is _FK]

    After designed.....I noticed that DeptNo_PK in table department is not linked to DeptNo_FK in table employee. (already defined the relationship by using SQL) So, I've no clue what's wrong with it. I am looking forward someone to assist me in this problem. Thank you.



    Click image for larger version. 

Name:	Table.JPG 
Views:	12 
Size:	30.6 KB 
ID:	15544
    Regards
    Paul

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Why use SQL to create tables?

    Delete the link and create correct one.

    Beware circular relationships. Review http://www.codeproject.com/Articles/...atabase-Design
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Paullhk is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2014
    Posts
    2
    Lecturer wants to test our SQL skill, so i have to use SQL to create it.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Sorry, don't know why Access did not create the link except maybe because there was already a link from the DeptNo PK. How does creating table with SQL control the PK/FK linking? Never had to do this.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    @Paullhk,
    Perhaps, if you spell out the role & relationship of each entity involved with the other entities, someone should be able to help out.
    For eg.
    1) How is dept related to deptlocation ?
    2) What is the relation between an employee, dept, deptlocation, project,...?
    .......

    Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with table and relationship design
    By fekrinejat in forum Database Design
    Replies: 4
    Last Post: 03-19-2013, 12:11 PM
  2. Table and Relationship Design
    By GrayWolf in forum Access
    Replies: 6
    Last Post: 01-31-2012, 02:04 PM
  3. Multiple Table Relationship Design
    By neo651 in forum Database Design
    Replies: 1
    Last Post: 09-30-2011, 01:16 AM
  4. Define Table with a Variable
    By Bedsingar in forum Queries
    Replies: 3
    Last Post: 07-18-2011, 07:07 AM
  5. Access Table - Relationship Question
    By vixtran in forum Database Design
    Replies: 5
    Last Post: 06-12-2009, 10:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums