INNER JOIN
The INNER JOIN
keyword selects records that have matching values in both tables.
Let’s look at a selection of the Products table:
ProductID | ProductName | CategoryID | Price |
---|---|---|---|
1 | Chais | 1 | 18 |
2 | Chang | 1 | 19 |
3 | Aniseed Syrup | 2 | 10 |
And a selection of the Categories table:
CategoryID | CategoryName | Description |
---|---|---|
1 | Beverages | Soft drinks, coffees, teas, beers, and ales |
2 | Condiments | Sweet and savory sauces, relishes, spreads, and seasonings |
3 | Confections | Desserts, candies, and sweet breads |
We will join the Products table with the Categories table, by using the CategoryID
field from both tables: Continue reading SQL INNER JOIN