If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Help ERD

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-11, 20:06
kabacade kabacade is offline
Registered User
 
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".
Reply With Quote
  #2 (permalink)  
Old 11-11-11, 21:22
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-12-11, 10:50
kabacade kabacade is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 11-12-11, 10:53
kabacade kabacade is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 11-12-11, 15:58
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
okay, i understand

but i cannot comment until i see all your foreign keys

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 11-12-11, 17:33
Martin22 Martin22 is offline
Registered User
 
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
Reply With Quote
  #7 (permalink)  
Old 11-12-11, 17:49
kabacade kabacade is offline
Registered User
 
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
Help ERD-erd.jpg  
Reply With Quote
  #8 (permalink)  
Old 11-12-11, 21:50
Martin22 Martin22 is offline
Registered User
 
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 22:03.
Reply With Quote
  #9 (permalink)  
Old 11-13-11, 19:23
kabacade kabacade is offline
Registered User
 
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
Help ERD-erd.jpg  
Reply With Quote
  #10 (permalink)  
Old 11-13-11, 23:32
Martin22 Martin22 is offline
Registered User
 
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
Reply With Quote
  #11 (permalink)  
Old 11-14-11, 11:40
kabacade kabacade is offline
Registered User
 
Join Date: Nov 2011
Posts: 11
ERD Help

her is new erd 2nd
Attached Thumbnails
Help ERD-erd.jpg  
Reply With Quote
  #12 (permalink)  
Old 11-14-11, 13:16
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by kabacade View Post
her is new erd 2nd
you might want to include all relevant foreign keys
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #13 (permalink)  
Old 11-14-11, 17:04
Martin22 Martin22 is offline
Registered User
 
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!
Reply With Quote
  #14 (permalink)  
Old 11-14-11, 19:02
kabacade kabacade is offline
Registered User
 
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
Help ERD-erd1.jpg  
Reply With Quote
  #15 (permalink)  
Old 11-16-11, 15:00
kabacade kabacade is offline
Registered User
 
Join Date: Nov 2011
Posts: 11
ERD Help

Any comment please?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On