mjcoco Posted May 11, 2008 Share Posted May 11, 2008 Ok im having trouble figuring this out. Here is my problem, say you have a table of Professors and a table of Courses Courses ex. COSC CPSC MATH HIST Professor ex. JOHN HARRY DAVE JIM JOHN can teach COSC and CPSC HARRY may only teach math etc... you get the point. Im having trouble with the logic. Im trying to figure out without having to make a column for every course ( COSC CPSC ) to be able to link Professors to many courses as in the JOHN example. Right now i have it to where they can only be associated with 1 course. For example 1 = COSC cour_id prof 1 JOHN But what im looking to do is for JOHN to be associated with COSC AND CPSC Quote Link to comment Share on other sites More sharing options...
mezise Posted May 11, 2008 Share Posted May 11, 2008 Hi, firstly I recommend you reading MySQL sticky topics or just simple SQL tutorials. Your problem is realy basic stuff... If one course may be teached by many professors and one professor may teach many courses use this structure: Professors table: | id | ProfessorName | | 1 | Profesor1 | | 2 | Profesor2 | Courses table: | id | CourseName | | 1 | Course1 | | 2 | Course2 | ProfessorsCourses table: | professor_id | course_id | | 1 | 1 | | 1 | 2 | Professor1 is associated with Course1 and Course2. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.