Results 1 to 8 of 8
  1. #1
    nyt1972 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    4

    Relationship / ERD according to data

    Dear Experts,

    Please help me creating an ER Diagram according to the following data, I am learning database programming please help.

    Data is as below:

    Students data



    Class : Section : Session : Admission No : Roll No : Name : FName
    Play Group A 2011 123 1 abc xyz
    Play Group A 2011 124 2 cdf ghq
    Play Group A 2011 125 3 def ryz

    Nursary A 2011 213 1 ghh ddd
    Nursary A 2011 214 2 jjj ttt
    Nursary A 2011 215 3 rrr ppp

    Nursary B 2011 315 1 ghh ddd
    Nursary B 2011 316 2 jjj ttt
    Nursary B 2011 317 3 rrr ppp
    etc.

    Please help, hope you understand

  2. #2
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    Class : Section : Session : Admission No : Roll No : Name : FName
    Play Group A 2011 123 1 abc xyz
    Play Group A 2011 124 2 cdf ghq
    Play Group A 2011 125 3 def ryz

    Nursary A 2011 213 1 ghh ddd
    Nursary A 2011 214 2 jjj ttt
    Nursary A 2011 215 3 rrr ppp

    Nursary B 2011 315 1 ghh ddd
    Nursary B 2011 316 2 jjj ttt
    Nursary B 2011 317 3 rrr ppp
    Table Classes: ClassID, ClassName, Section
    Table Sessions: SessionID, SessionName
    Table Students: StudentID, AdmissionNo, FirstName, LastName
    Table Classrooms: StudentID, ClassID, SessionID, RollCallNo

    You do not need a table for Sections as they fit well into Classes table.
    All three tables have foreign keys in table Classrooms.
    RollCallNo is classroom-specific, do NOT include it in Students table.
    You can show your desired output (including Section) via a query joining the Classrooms table to the three foreign key tables.
    Classrooms is a junction table because Students and Classes have a many-to-many relationship.

  3. #3
    nyt1972 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    4
    Thanks for the reply dear, attached is the image of my tables relationships, pls check, is it ok?

  4. #4
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    Perfect. Continue.

  5. #5
    nyt1972 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    4
    When I enter Student Record it say, duplicate values in the index, primary key or relationship.....

  6. #6
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    That means you are trying to enter a record whose primary key (or index or relationship, as the message says) conflicts with that of an existing record. What happens when you try a different record?

  7. #7
    nyt1972 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    4
    problem is with StudentID, should I enter ID myself or computer with generate automatically if I enter new record.

  8. #8
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    If the field's datatype is AutoNumber, then Access will supply the value, you do not have to specify it.

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

Similar Threads

  1. Relationship
    By ClownKiller in forum Database Design
    Replies: 13
    Last Post: 12-21-2010, 05:49 PM
  2. Replies: 4
    Last Post: 10-07-2010, 04:45 PM
  3. one to many relationship?
    By cowboy in forum Access
    Replies: 3
    Last Post: 06-16-2010, 02:37 PM
  4. Replies: 0
    Last Post: 03-15-2010, 02:38 AM
  5. MAY TO MANY RELATIONSHIP
    By fadone in forum Database Design
    Replies: 2
    Last Post: 12-20-2005, 09:03 AM

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