MULTIPLE-TABLE SELECT
Examples
- Sales by Category
- Invoices
Exercise
Create a list of products that shows the category name for
each and the contact name of the supplier.
Type the following statement in the SQL window:
SELECT Suppliers.CompanyName, Suppliers.ContactName,
Suppliers.Address, Suppliers.City, Suppliers.PostalCode, Suppliers.Country,
Products.ProductName,
CategoryName
FROM Categories
INNER JOIN (Suppliers
INNER JOIN Products
ON
Suppliers.SupplierID=Products.SupplierID)
ON Categories.CategoryID=Products.CategoryID;
Tip: To analyze or troubleshoot a query in the
Access query window or in the command line utility in Oracle or MySQL, try
breaking the statement as shown in the syntax diagram, with the keywords at the
beginning of the lines; or copy and paste to a text editor (e.g., Notepad) and
rearrange there.