Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: Help ERD

  1. #1
    Join Date
    Nov 2011
    Posts
    11

    Help ERD

    Hi can any one help for ERD relationship for "Trainset run professional short courses. These courses have a title, a duration of 1,2,3,4,or 5 days, and a cost that varies between 300 and 2000. The courses are repeatedly run at various locations. The start date of each offering, its location and its instructor are recorded. Students attend the courses and Trainset need to record the student name, gender, telephone number, and company name. Each time a student attends a course they will give an evaluation of the course (the evaluation is a number from 0 to 4), and attempt an examination. Trainset need to record the examination result of each student in each examination. It is not a requirement that all offerings of courses have attendees registered, and it is also not required that every student has to have attended a course".

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, there are several people on this forum who can help

    but we won't do the work for you

    you have to do it, and then ask specific questions if you have trouble
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2011
    Posts
    11
    Sorry, this is not about you doing my work, I just ask how many entity relation and tables are there?

    I am new bee in database. I found 5 entities (Student, instructor,course, offering, taking/attendance) I just want to know if this is correct, so i can continue working, thank you.

  4. #4
    Join Date
    Nov 2011
    Posts
    11

    Help ERD

    Sorry, this is not about you doing my work, I just ask how many entity relation and tables are there?

    I am new bee in database. I found 5 entities (Student, instructor,course, offering, taking/attendance) I just want to know if this is correct, so i can continue working, thank you.

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    okay, i understand

    but i cannot comment until i see all your foreign keys

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Nov 2011
    Posts
    30
    r937,

    I understand what you're trying to do, but to be honest with you, try to make the database yourself, and post the ERD online. Based off of that, then we can tell you if you're correct, and if your logic is sound. Without doing that, we cannot give you the answer.

    FYI, there are probably more than five tables, due to many-to-many relationships. Many-to-many relationships don't exist in real life, but when doing an ERD, they do. When it comes to making a database with a many-to-many relationship, three tables must be made, not two. The third table will contain the primary key from BOTH tables that are related many-to-many in the ERD.

    I hope this helped you a little bit in figuring out how many tables you should have. That's the first step I always take in creating databases is to define my tables. Once done, define your fields (also known as attributes), then define the cardinality (also known as relationship). If you're not sure if it's right, say it out loud to yourself, one step at a time, and ask yourself if it makes sense. Once done, put some data in it and see if it works. If not, see where you messed up and continue on with the process. One thing you don't want to do is start using a database for a year, then find out that it's wrong. Data conversion is very expensive, and it is not easy to do, especially for those new to databases.

    I wish you the best of luck, and post back if you have any more questions!

    Martin

  7. #7
    Join Date
    Nov 2011
    Posts
    11

    Erd

    Hi

    Here is my ERD, please have a look and give me feedback if you can.

    thanks
    Attached Thumbnails Attached Thumbnails ERD.jpg  

  8. #8
    Join Date
    Nov 2011
    Posts
    30
    Quote Originally Posted by kabacade View Post
    Hi

    Here is my ERD, please have a look and give me feedback if you can.

    thanks
    In my opinion, your tables are not defined correctly. In order to define them correctly, ask yourself these two questions: Is it important, and can I explain it?

    So, let's use Attendance for example.

    Is attendance important? Yes, it definitely is. Can you explain it? Not really. Attendance just means if the student is there or not. Rather, pick a different word, like Date. Is a date important? Absolutely. Can you describe a date? In this case, yes, because in one date, a student can be in class, or not in class. Moreover, within one date, at least one, or many lessons can be taught. See what I'm getting at.

    By the way, I reread your requirements and you stated that classes are ran at various locations. If this is true, why is location not a table?

    Martin
    Last edited by Martin22; 11-12-11 at 23:03.

  9. #9
    Join Date
    Nov 2011
    Posts
    11

    ERD Help

    Thank you very much for your effort, and time. Your explanation is very useful, Here is another try, can you please give me feedback, if the tables are working correctly.
    Attached Thumbnails Attached Thumbnails ERD.jpg  

  10. #10
    Join Date
    Nov 2011
    Posts
    30
    Quote Originally Posted by kabacade View Post
    Thank you very much for your effort, and time. Your explanation is very useful, Here is another try, can you please give me feedback, if the tables are working correctly.
    I'm glad to hear that I am helping someone here, after just being here for one day!

    That is definitely much better than before. I just have a few questions for your database:

    Are courses being taught by more than one teacher? If so, then your database is incorrect, and we will discuss that when you post back.

    In the Instructor Table, you may want to put the FirstName and LastName of the Instructor, rather than just name. The reason for this is because you are putting two attributes (FirstName, LastName) within one attribute, which violates theory, (the scalar property).

    From the database, it reads like this: One courses can have many locations. One location can only have one course. Is this what you are looking for? If not, please let me know and we can fix it together. The same goes for some of the other relationships. One student can have many examinations, but one exam is taken by one student.

    Other than that, the tables look great! Good job!!

    Please post back so we can further discuss this.

    Martin

  11. #11
    Join Date
    Nov 2011
    Posts
    11

    ERD Help

    her is new erd 2nd
    Attached Thumbnails Attached Thumbnails erd.jpg  

  12. #12
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by kabacade View Post
    her is new erd 2nd
    you might want to include all relevant foreign keys
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  13. #13
    Join Date
    Nov 2011
    Posts
    30
    Quote Originally Posted by r937 View Post
    you might want to include all relevant foreign keys
    I agreee with r937. It isn't that we cannot understand the ERD, but it helps us understand how much you know, so we can better assist you. Please post back, and I'll be more than welcome to assist!

  14. #14
    Join Date
    Nov 2011
    Posts
    11

    ERD Help

    Yes Martin your right, I try to understand but it takes a time. what is confuse me are 1) the all offerings of courses are uniquely identified by a single key column called offering_id
    2) Attendance records are identified by a combination of foreign keys (not by a single column surrogate key)
    In this case I changed examanation table to overing table. is this correct option?

    i am looking for One course can have many locations and One location can also have many courses. One student can have many examinations, as well as one exam is taken by many students. But now I changed the tables some thing like this.

    please any idea!
    Attached Thumbnails Attached Thumbnails erd1.jpg  

  15. #15
    Join Date
    Nov 2011
    Posts
    11

    ERD Help

    Any comment please?

Posting Permissions

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