Question
In Northwind Database 2. List the CustomerID and the average Freight cost for each customer. Name the Freight column Average Freight Cost. Display the Average
In Northwind Database
2. List the CustomerID and the average Freight cost for each customer. Name the Freight column "Average Freight Cost." Display the "Average Freight Cost" with two decimal places.
SELECT CustomerID, avg(Freight) as "Average Freight Cost" FROM orders GROUP BY CustomerID; *I need to display 2 decimal places here for Average Freight cost*
3. List the same information in step 2 but only for customers who have an average freight cost more than $100. Again, ensure to display the "Average Freight Cost" with two decimal places.
SELECT CustomerID, avg(Freight) as "Average Freight Cost" FROM orders GROUP BY CustomerID HAVING avg(Freight) >100; *Same as number 2, but also need to display 2 decimal places*
4. List each Employees ID along with their first and last name and their most recent order date. Name the column that shows the most recent order date as "Most Recent Order". (Hint: This will require the use of two tables, the employees and orders tables.) *Mainly just need this question* Thanks for you help
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