D
David M C
Yes, you can have as many employees as you like. But they can't each be
enrolled in the same course. You would have to create another course entry.
If you look at the table structure your model suggests you would have:
EmployeeID EmployeeName
1 Fred
2 Bob
3 Jim
CourseID CourseName EmployeeID
1 Jumping 1
Now, you can't have Jim also enrolled in "Jumping" because there is nowhere
to store his ID. Instead, you would have to create another "Jumping" course.
CourseID CourseName EmployeeID
1 Jumping 1
2 jumping 3
Now, tell me how you are going to create a query that shows me all the
employees that are enrolled in the Jumping course? Think of all the different
ways a user could type "Jumping" which you're going to have to allow for in
you query. Also remember that a course may have the same name, but be a
different course.
The whole point of using a relational database is to avoid duplication. By
having to enter all that course information again, just to have many
employees enrolled in it, is verging on insanity. Especially when creating a
junction table to model the data properly is so easy.
Dave
enrolled in the same course. You would have to create another course entry.
If you look at the table structure your model suggests you would have:
EmployeeID EmployeeName
1 Fred
2 Bob
3 Jim
CourseID CourseName EmployeeID
1 Jumping 1
Now, you can't have Jim also enrolled in "Jumping" because there is nowhere
to store his ID. Instead, you would have to create another "Jumping" course.
CourseID CourseName EmployeeID
1 Jumping 1
2 jumping 3
Now, tell me how you are going to create a query that shows me all the
employees that are enrolled in the Jumping course? Think of all the different
ways a user could type "Jumping" which you're going to have to allow for in
you query. Also remember that a course may have the same name, but be a
different course.
The whole point of using a relational database is to avoid duplication. By
having to enter all that course information again, just to have many
employees enrolled in it, is verging on insanity. Especially when creating a
junction table to model the data properly is so easy.
Dave