Results 1 to 6 of 6
  1. #1
    alexthefourth is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2013
    Posts
    6

    problems creating one to one relationship

    i have two tables, student and transcript.




    a student can have only one transcript and a transcript belongs to only one student.
    im having trouble creating this relationship in access 2013. is there a way to create this?


    also, can there be a one to one relationship between two different primary keys?


    these are my tables

    Transcript
    ------------
    transcriptID(PK)
    courseID
    grade
    studentID

    Student
    ---------
    studentID(PK)
    major
    fName
    lName
    GPA

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Both keys cannot be autonumber.

    Why bother with two tables if this is truly a 1-to-1 relationship? However, I have doubts it is. Each student can have many courses and each course can associate with many students. This is a many-to-many relationship and Transcript is junction table that associates students with courses.

    Shouldn't GPA be calculated when needed and not saved in table?
    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
    alexthefourth is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2013
    Posts
    6
    thank you, that makes sense.

  4. #4
    alexthefourth is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2013
    Posts
    6
    I have one more problem course has prereqs(courses that must be taken before a specific course) and coreqs(courses that must be taken along with a specific course)

    i guess this would be a unary relationship so one course can have many courses. but how can this be modeled with relationships?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This is like a family tree database. Which is, IMHO, a difficult model (manufacturing is another). I do have something similar.

    I have laboratory tests that have companion tests. I have a table of all tests and then another table that associates a 'master' test with companion tests. Some companion tests can be associated with multiple masters. Some of the 'companion' tests can be selected independently of the master. The master tests always call for the companions. Because test data has to be saved into separate tables for each test involved (even the companion tests), I have lots of code to manage this when a sample is logged in and tests are selected.

    Possibly you need two tables for the two types of associations.
    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.

  6. #6
    alexthefourth is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2013
    Posts
    6
    what do you have in the second table? and whats the relationship between the master test and second test table?

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

Similar Threads

  1. Relationship problems
    By BarbT in forum Access
    Replies: 5
    Last Post: 09-05-2011, 09:39 AM
  2. Relationship problems!
    By oo0tommyk0oo in forum Access
    Replies: 11
    Last Post: 07-18-2011, 11:47 AM
  3. Relationship problems in access
    By danish raza in forum Database Design
    Replies: 1
    Last Post: 07-10-2011, 05:50 AM
  4. Replies: 1
    Last Post: 03-31-2010, 11:57 PM
  5. Relationship problems????
    By geoffishere in forum Access
    Replies: 6
    Last Post: 02-07-2010, 04:01 PM

Tags for this Thread

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