DB section has been updated to add some SQL code.
So far we have only been manipulating one table at a time but if we want to show the Instructor Name and the Course Titles and Dates that they teach if we look at the two tables below we need fields from both tables.
To do this so far we could use: SELECT Instructor.Name, Course.Title, Course.Date FROM Instructor,Course
At the minute we are seeing 20 records instead of 5. We are seeing every Instructor is reaching every course. It can be represented using the diagram to the right:
To overcome this we will use an equi join, this is when two matching columns from related tables are selected (joined) using the foreign key.
When we perform this type of JOIN we are selecting records that have matching values in BOTH tables.
This covers how to use a SELECT statement when using more than one table