CIS 336 All Assignments CIS 336 All Assignments | Page 47
Lab 5 will introduce the concept of multi-table JOINS in order to work with data in two or more
related tables simultaneously. This lab may be completed using either DeVry’sOmnymbus
EDUPE-APP lab environment, or a local copy of the MySQL database running on your own
computer using the OM database tables. The lab will utilize a set of tables that are represented
by the ERD (OM_ERD.docx) and are created and populated by the script file
(create_OM_db.sql). Follow the instructions in the file CreateOMTables.docx to create your
database, tables, and data.
A few IMPORTANT things to note if using EDUPE MySQL:
**There can be NO SPACES in alias names given to a column. For example:
Select unit_price as “Retail Price “ from items; –this does NOT work in EDUPE MySQL.
Any of the following WILL WORK:
Select unit_price as “RetailPrice” from items;
Select unit_price as “Retail_Price” from items;
Select unit_price as Retail_Price from items;
Select unit_price as RetailPrice from items;
**Any calculated fields MUST be given an alias (and note above NO SPACES in alias). For
example:
select unit_price * 2 from items; –this does NOT work in EDUPE MySQL
This will work:
select unit_price * 2 as NewPrice from items;
Deliverables
• Lab Report (Answer Sheet) containing both the student-created SQL command(s) for each
exercise, and the output showing the results obtained. Be sure your name is on the file.
LAB STEPS: Complete each of the exercises below:
1. Use the JOIN ON syntax to write a query to display the order id, order date, customer name
formatted as a single field (i.e. “Tom Jones”) with a heading of Customer, and customer_city for
customers residing in the state of OHIO. Sort the output to display the newest orders first.