Skip to content

NeeRaj-2401/northwind-sql-queries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 

Repository files navigation

Northwind SQL Queries

This repository contains a collection of SQL queries written for the Northwind database. The Northwind database is a sample database commonly used for learning and practicing SQL.

The queries in this repository cover a wide range of scenarios and aim to provide insights and analysis on the Northwind database. Each query is numbered and has a corresponding description of its purpose.

Queries

  1. Get the total number of orders placed by each customer
  2. Find all suppliers who provide products in the 'Seafood' category
  3. Get the total quantity of each product sold
  4. Find the total sales (Quantity * Unit_Price) for each category of products
  5. List the employees and the number of orders each employee has taken
  6. Get the customers who have placed more than 10 orders
  7. Get the top 5 most sold products
  8. Find the products that have never been ordered
  9. Find the customers who have not placed any orders
  10. List all 'Orders' with 'Customer' details and 'Employee' who processed it
  11. Calculate the average product price by category
  12. Find the total revenue generated by each employee
  13. List all orders shipped to 'Germany'
  14. Find the most expensive product in each category
  15. Find the total revenue for the year 2016
  16. List all products that are discontinued
  17. List all the distinct countries to which orders have been shipped
  18. Find all employees who report to 'Andrew Fuller'
  19. Find the customers who have spent more than $5000 in total
  20. List the top 5 employees who have processed the most orders
  21. Get the list of customers who have ordered 'Chai' product
  22. Get the employees who have processed orders for 'Chai' product
  23. Find the most common shipping country
  24. Find the order with the highest total cost
  25. Find the employees who have processed more than 100 orders
  26. Find the customer who has ordered the most 'Chai' product
  27. Find the average quantity of products ordered in each order
  28. Find the top 3 most popular categories of products ordered
  29. Find the month in the year 2016 with the highest total sales
  30. Find the employee who processed the most orders in August 2016
  31. Find the top 3 customers who have ordered the most products
  32. Find the employees who have not processed any orders
  33. Find the suppliers who supply the top 5 most sold products
  34. Find the customers who have ordered products from all categories
  35. Find the total sales for each year
  36. Classify customers based on their total order amounts such that total order amounts > 5000 should be classified as 'High Value', if > 1000 then as 'Medium Value', and otherwise as 'Low Value'
  37. Classify products based on their sales volume such that TotalQuantity > 1000 is classified as 'High Sales'. If TotalQuantity > 500, it is classified as 'Medium Sales', and otherwise as 'Lower Sales'
  38. Classify employees based on the number of orders they have processed such that NumberOfOrders > 100 is classified as 'High Performing'. If NumberOfOrders > 50, it is classified as 'Medium Performing', and otherwise as 'Lower Performing'

Schema

Acknowledgments

  1. The Northwind database used in this repository is a sample database provided by Microsoft. It serves as a useful resource for learning and practicing SQL.
  2. SQL-Practise Website.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published