i am working in mysql, i know about tables relationships 'joins' etc, I have three different tables, each table has column id, i want to combine all three ids in one main table, because i want to apply inner join after getting all ids in one table. can you please tell me how i can get all three ids in one table, i know about foreign key and primary key, but i don't know how i can apply that here... or is there any simple method of doing it. My tables name:
Table 1 contains: student_id coloumn
Table 2 contains: teachers_id
Table 3 contains: class_id
Main table is table 4: which will have student_id,teachers_id,class_id coloumn
i am trying to generate time table, i want get student id,teachers_id and class_id, in main table time_table; i am trying to do normalization so that i don't have to repeat all name again and again, i can just use id to call any class name teacher name subject name etc, all ids are primary keys in tables.
The relationship is one to one in this case
i am working on php_mysql.
Thankyou