Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Write a SQL query that will return the total number of Offices Should return a single number
Select all the columns from the offices table. Sort by country, then state, then city.
Select the employee number and employee name of all the employees who work in the Sydney Australia office.
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.
Select all products that have the word "Guzzi" or "Ferrari"
do not include the quotes in the productName
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.
Select orderNumber, orderDate, status, and comments for orders whose shippedDate is between June and April and the status is "Cancelled" dont include the quotes Sort the results by orderDate in descending order.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started