elifgazioglu / sql-query-examples

SQL query examples for NORTHWIND databasee

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL query examples (NORTHWIND database) 👩‍💻 ⚡️

Queries

1.Write a query to get Product name and quantity.

2.Write a query to get current Product list (Product ID and name).

3.Write a query to get current Product list where the "Discontinued" column has a value of '1'.

4.Write a query to get most expensive and last expensive

5.Write a query to get Product list (id, name, unit price) where current products cost less than $20.

6.Write a query to get Product list (id, name, unit price) where products cost between $15 and $25.

7.Write a query to get the avarage of the Products.

8.Write a query to get Product list (name, unit price) of above average price.

9.Write a query to get count of Discontinued is 0

10.Write a query to get Product list (name, units on order , units in stock) of stock is less than the quantity on order.

11.Write a query to list employees whose address does not contain Rd.

12.Write a query to list all those employees whose TitleofCourtesy does not starts with M.

13.List order details whose ShipRegion is not Null.

14.All products where UnitPrice is between 10 and 15 and QuantityPerUnit contains “bottles”

15.List all products where UnitPrice is not in 10,12,15,17 or 19.

16.Write a query, TitleOfCourstey value is Male if it is Mr., Female if it is Mrs or Ms.

17.Write a query to show how many customers there are in each country.

18.Write a query to show the total stock quantity of products by categories.

19.Write a query to show the distribution of orders by years.

20.Write a query to show the highest unit price of products in each category.

21.Write a query to show the total order counts by customer cities.

22.Write a query to show the countries with more than 3 customers.

23.Write a query to show the categories with an average unit price greater than 30.

24.Write a query to find the average order amount for each customer in the "Orders" table.

25.Write a query to find the youngest and oldest employees in the "Employees" table based on their birthdates.

26.Write a query to sort the products in the "Products" table in descending order based on their stock levels.

27.Write a query to find the total expenditure made by each customer in the "Orders Details" table.

28.Write a query to find the customer who placed the most orders in the "Order Details" table.

29.Write a query to find products in the "Products" table with prices higher than the average price of other products.

30.Write a query that shows the CompanyName, ContatTitle, City, Country of all customers in any ciy in Mexico or oher cities in Spain than Madrid.

About

SQL query examples for NORTHWIND databasee