Question: Install the JoesModels database - Download the SQL script to install the database ( JoesCarModels . sql ) - Run the script IMPORTANT * *

Install the JoesModels database
- Download the SQL script to install the database
(JoesCarModels. sql)
- Run the script
IMPORTANT ******
*Give all calculated columns a descriptive alias.
*Hint* Check for primary and foreign key relationships when joining tables
*Each question should be answered with a single query
1) Write a SQL query that will return the total number of Offices (Should return a single number).
2) Select all the columns from the offices table. Sort by country, then state, then city.
3) Select the employee number and employee name of all the employees who work in the Sydney Australia office.
4) Select the CustomerName from the Customers table, and the Representative name for that customer from the employees table (Concatenate the employees lastname and firstname.
Ex. Record - "Ortiz, Joseph"). Give the customers table an alias (correlation name) of C and the Employees table an alias of E. Sort the result set by customer name.
5) Select all products that have the word "Guzzi" or "Ferrari"
(do not include the quotes) in the productName
6) Select the Customers that DO NOT HAVE an employee as their salesRep. The result set should contain the customerName and state from the customers table, and lastName, and firstName from the Employees table.
7) Select orderNumber, orderDate, status, and comments for orders whose shippedDate is between June 01,2003 and April 01,2004 and the status is "Cancelled" (don't include the quotes). Sort the results by orderDate in descending order.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!