Advanced_SQL_Assignment
Advanced_SQL_Assignment
Scenario:
You are hired as a data analyst for a company that manages customers, their orders, shipments,
and employee relationships. Your task is to use SQL to extract insights, optimize queries, and
analyze
Dataset:
Assignment Tasks:
a. Write a query to list all customers and their corresponding order details. Include customers who
b. Create a report showing all employees and their respective managers. Include employees who
2. Combining Queries:
a. Combine the results of customers who have either placed orders or have shipments, avoiding
a. Write an optimized query to find the total amount of orders placed by each customer. Display
a. Write a query to create a hierarchy of employees, showing their name, position, and their
manager's name.
a. Simulate a FULL OUTER JOIN between the Customers and Orders tables and retrieve all
records.
6. Advanced Challenge:
- Customer Name.
- A column indicating if the customer is a High-Value Customer (total order amount > 10,000).
Submission Guidelines:
1. Save all queries in a .sql file with comments explaining the logic for each query.
2. Test your queries against the dataset and ensure they produce correct results.