DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Er Diagram Explanation!

  1. #1
    Join Date
    Feb 2001
    Location
    alexandria
    Posts
    100

    Er Diagram Explanation!

    it has been a while since i did this level just want to make sure i got all the entities and attributes

    1.we are a school we teach many coursers each has a code name and a fee
    sandra and james are our best teahers we track the instructors name and phone number . we create a course and line it up with the teacher
    several students cand take serveral courses . we track each student by name and phone number some dont give out their phone number
    we want to tract each student enrolled in a course grade and also which teacher taught the course

    OK HERE ARE MY THOUGHTS PLZ CORRECT ME IF I AM WRONG

    STUDENT (studentid, studentname, phonenumber)
    COURSE (courseid, coursename, teacher)
    REPORT(studentidm course, grade)
    TEACHER(teacherid, name, phone number, course id)

    please help if i have missed anything thanks

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    If a teacher's phone number changes, how many records have to be updated? For every course a teacher teaches, do you really want to record the teacher's personal info? How does a student know which courses he or she is enrolled in (is that a typo for courseid in the REPORT table)? To get a report, wouldn't you also want the term, enrollment status (withdrew, incomplete, etc.), and GPA (that means you also need to record credit hours)?

    You need a lookup table for teacherid and courseid (get rid of courseid in the teacher table). The lookup (or intersection) table uses a composite primary key: teacherid and courseid.

  3. #3
    Join Date
    Feb 2001
    Location
    alexandria
    Posts
    100
    Originally posted by stecal
    If a teacher's phone number changes, how many records have to be updated? For every course a teacher teaches, do you really want to record the teacher's personal info? How does a student know which courses he or she is enrolled in (is that a typo for courseid in the REPORT table)? To get a report, wouldn't you also want the term, enrollment status (withdrew, incomplete, etc.), and GPA (that means you also need to record credit hours)?

    You need a lookup table for teacherid and courseid (get rid of courseid in the teacher table). The lookup (or intersection) table uses a composite primary key: teacherid and courseid.
    thanks it was a typo in the report table should have been course id.

    you have a point i am a little rusty on here
    thanks

    what would be a good name for a look up table?

  4. #4
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by imose
    what would be a good name for a look up table?
    I personally wouldn't call this a "lookup table" (lookup tables, for me, associate an id with a description: e.g. FL => Florida or Fürstentum Lichtenstein - is that what DWH people call dimension tables?).

    I was taught to call these "associative" entities. If you don't find they correspond to anything that has a real-life name, then M2M_TEACHER_COURSE is as good as anything.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width