Quick Reference
The INNER JOIN keywords returns rows that have matching values in both tables.
The following returns all orders that have customer information.
SELECT Orders.order_id, Customers.last_name, Customers.first_name
FROM Orders
INNER JOIN Customers ON Orders.customer_id = Customers.customer_id;
Note
The INNER JOIN keywords selects all rows from both tables as long as there is a match between the columns. If there are records in the Orders table that do not have matches in the Customers table, these orders will not be shown.
SQL Notes:
- Any work being done to modify the structure of a database or delete tables or the the database itself should only be done after making a recent backup
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.