SQL Queries Practice & Solutions

Solve following queries using aggregate functions for the table.

Table: sales (orderID OrderDate OrderPrice OrderQuantity CustomerName)

0

1.Count how many orders have made a customer with customer name of Smith.

1

2.Find the number of unique customers that have ordered from the store.

2

3.Find out total no. of items ordered by all the customers.

3

4.Find out the average number of items per order.

4

5.Find out the average order quantity for all orders with order price greater than 200.

5

6.Find out what was the minimum price paid for any of the orders.

6

7.Find out the highest order price from the given sales table.

7

8.List out unique customers name only from the table.

8

9.List out the name of the customers who have given an order in the month of DECEMBER.

9

10.Find out the total amount of money spent for each of the customers.

10

11. Select all unique customers, who have spent more than 1200 in the store.

11


Now I had updated my table and inserted more values in it.

Capture


12.Select all the customers that have ordered more than 5 items in total from all their orders.

12

13.Select all customers who have spent more than 1000, after 10/01/2005.

13

14.Select orders in increasing order of order price.

14

15 Select orders in decreasing order of order price.

15


Thank You, Like, Share, Subscribe.

Advertisements

100 Most Important Abbreviations Of Information & Communication Technology ( ICT )

100 Most Important Abbreviations Of  Information & Communication Technology, ICT.

To Get FREE Pdf Click Here Or Download From -> GENERAL Abbreviations 

 

                      Watch Full Lecture On Youtube:-

 

OSI Model (Open System Interconnection) Networking Model

OSI Model Stands For Open System Interconnection Model Which Is Consists Of Seven Layers.

  1. Physical layer
  2. Data Link Layer
  3. Network Layer
  4. Transport Layer
  5. Session Layer
  6. Presentation layer
  7. Application Layer

All Layers Have Their Own Functions And Responsibilities. For Getting Into Details Watch The Video Given In Link Below.

Complete OSI Model Watch Here.

 

For Getting Complete Lecture In PDF Format. Comment OSI Model On Video.