7. Assignment SQL Joins
7. Assignment SQL Joins
Objective:
This assignment will help you gain hands-on experience with SQL INNER JOIN, LEFT JOIN,
RIGHT JOIN, FULL JOIN, and CROSS JOIN while working with large financial datasets.
3. Payments Table
5. Find customers who have placed orders but have not made any payments.
6. Retrieve a list of customers along with the total amount they have spent, even if they
haven't placed an order.
7. Find all orders that were canceled but still have a payment record.
8. List all customers along with their orders and the products they purchased (join
Customers, Orders, and Products).
9. Retrieve orders with their payment details, ensuring even unpaid orders appear in the
result.
Part 3: Advanced Queries
10. Find the total amount spent by each customer using JOINs.
11. List all customers who have made multiple payments.
12. Identify the top 3 highest-paying customers.
13. Retrieve orders with missing customer information.
14. Identify customers who have placed at least 3 orders.
15. Find customers who live in the same city and have placed an order in 2023.
16. List customers who have placed an order but have NULL email addresses.
Submission Guidelines
• Write SQL queries for all the above questions.
• Provide query outputs along with explanations.
• Ensure optimized queries for large datasets.