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".
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!
Here is my ERD, please have a look and give me feedback if you can.
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?
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!!
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.