Giter VIP home page Giter VIP logo

sql-query-examples's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.