05 Laboratory Exercise Join Clauses
05 Laboratory Exercise Join Clauses
Materials:
PC with installed Microsoft Access 2007 (or later)
Flash drive
Procedures:
In this laboratory exercise, we will create and use the tblCustomers and tblItems_Ordered tables in
OrderDB database.
Table 1 tblCustomers
Table 2 tblItems_Ordered
3. Open a New Query editor to combine the two tables using the INNER JOIN as follows:
4. The SQL above would produce the following result. Name the query as “Inner Join”.
5. Consider the two tables above, now, join the tables using LEFT JOIN. Follow the SQL below, Name
the query as “LEFT JOIN”
Use tblCustomers and tblItems_ordered tables in OrderDB database. Write in your Yellow Pad.
1. Create a SQL command that will display the CustomerID, LastName, Item, Quantity, and Price using
INNER JOIN clause ORDER BY LastName.
2. Create a SQL command that will display the CustomerID, LastName, Item, Quantity, and Price using
INNER JOIN clause where CustomerID = 10449 ORDER BY LastName.
3. Create a SQL command that will display the CustomerID, LastName, Item, Quantity, and Price using
LEFT JOIN clause where Price > 25 ORDER BY CustomerID.
Challenge Exercise : FULL JOIN is not supported by MS ACCESS. FULL JOIN allows
you to combine the LEFT and RIGHT JOINS (allowing NULL values on both sides)
Figure out an approach that will display the CustomerID, LastName, Item, Quantity, and
Price using – similar to a full join - where Item or Quantity is null ORDER BY
CustomerID.