DBMS Lab
DBMS Lab
1.From the following tables write a SQL query to find salespeople who received
commissions of more than 12 percent from the company. Return Customer Name,
customer city, Salesman, commission.
2.From the following tables write a SQL query to find those customers with a
grade less than 300. Return cust_name, customer city, grade, Salesman,
salesmancity. The result should be ordered by ascending customer_id.
3.Write a SQL statement to make a report with customer name, city, order
number, order date, and order amount in ascending order according to the order
date to determine whether any of the existing customers have placed an order or
not.
4.SQL statement to generate a report with customer name, city, order number,
order date, order amount, salesperson name, and commission to determine if
any of the existing customers have not placed orders or if they have placed
orders through their salesman or by themselves.
5. Write a SQL statement to generate a list in ascending order of salespersons
who work either for one or more customers or have not yet joined any of the
customers.
6.Write a SQL statement to make a list for the salesmen who either work for one
or more customers or yet to join any of the customer. The customer may have
placed, either one or more orders on or above order amount 2000 and must have
a grade, or he may not have placed any order to the associated supplier.
7.Write a SQL statement to generate a report with the customer name, city, order
no. order date, purchase amount for only those customers on the list who must
have a grade and placed one or more orders or which order(s) have been placed
by the customer who neither is on the list nor has a grade.