0% found this document useful (0 votes)
1K views10 pages

Write A Query To Display All Customers With A Grade Above 100

This document provides 20 SQL queries to retrieve information from database tables related to customers, orders, salesmen, and their attributes. The queries include filtering on city, grade, date, salesman ID, purchase amount, and other fields. They also include aggregation functions to find totals, averages, maximums, minimums and counts.

Uploaded by

arif arifin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views10 pages

Write A Query To Display All Customers With A Grade Above 100

This document provides 20 SQL queries to retrieve information from database tables related to customers, orders, salesmen, and their attributes. The queries include filtering on city, grade, date, salesman ID, purchase amount, and other fields. They also include aggregation functions to find totals, averages, maximums, minimums and counts.

Uploaded by

arif arifin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

1.

Write a query to display all customers with a grade above


100.

2. Write a query statement to display all customers in New


York who have a grade value above 100.

3. Write a SQL statement to display all customers, who are


either belongs to the city New York or had a grade above
100.
4. Write a SQL statement to display all the customers, who
are either belongs to the city New York or not had a
grade above 100.

5. Write a SQL query to display those customers who are


neither belongs to the city New York nor grade value is
more than 100.
6. Write a SQL statement to display either those orders
which is not issued on date 2012-09-10 and issued by the
salesman whose ID is 5005 and below or those orders which
purchase amount is 1000.00 and below.

7. Write a SQL statement to display salesman_id, name, city


and commission who gets the commission within the range
more than 0.10% and less than 0.12%.

8. Write a SQL statement to find the total purchase amount


of all orders.
9. Write a SQL statement to find the average purchase amount
of an order.

10. Write a SQL statement to find the number of salesmen


currently listing for all of their customers.
11. Write a SQL statement know how many customer have listed
their names with other information.

12. Write a SQL statement find the number of customers who


gets at least a gradation for his/her performance.

13. Write a SQL statement to get the maximum purchase amount


of all the orders.
14. Write a SQL statement to get the minimum purchase amount
of all the orders.

15. Write a SQL statement which selects the highest grade for
each of the cities of the customers.
16. Write a SQL statement to find the highest purchase amount
ordered by the each customer with their ID and highest
purchase amount.

17. Write a SQL statement to find the highest purchase amount


ordered by the each customer on a particular date with
their ID, order date and highest purchase amount.

18. Write a SQL statement to find the highest purchase amount


in a date '2012-08-17' for each salesman with their ID.
19. Write a SQL statement to find the highest purchase amount
with their ID, for only those customers whose ID is
within the range 3002 and 3007.

20. Write a SQL statement that counts the number of different


non NULL city values for salesmen.
UNIVERSITY COLLEGE OF AGROSCIENCE
MALAYSIA
FACULTY OF SCIENCE COMPUTER

ICB 20503
DATABASE MANAGEMENT SYSTEM

INDIVIDUAL ASSIGNMENT
PREPARED BY:
AHMAD ARIF BIN ARIFIN 26211115001
(BCEM 4)
PREPARED FOR:
MADAM NADZIRAH BINTI ROSLAN
DATE OF SUBMISSION:
25 MAY 2017

You might also like