Home > database >  If one table can provide the info we need, do I need to join another table
If one table can provide the info we need, do I need to join another table

Time:10-07

I have two tables, table1 has a foreign key of table2. I want to get some info from table1 including a column which both table1 and table2 have. Should I join these two table to get the info? For example: I have two tables Course and Student, such as below

enter image description here

This is how entities and relationships should be organized if we are talking about the common scenario of designing a database for a school or something something similar to this.

There is a Many to Many relationship between Courses and Students, which allows us to associate N students with one course, and M courses with one student (one course can be attended by many students, and one student can attend many courses).

Also, this design follows the 3rd Normalization Form.

Learn more about normalization forms

Learn more about Many to Many relationships

  • Related