Question: Consider the tables and write down SQL statements for the questions. 1 . Find the salesperson and customer who reside in the same city. Return

Consider the tables and write down SQL statements for the questions.
1. Find the salesperson and customer who reside in the same city. Return Salesman, cust_name and city.
2. Find those orders where the order amount exists between 500 and 2000. Return ord_no, purch_amt, cust_name, city.
3. Find the salesperson(s) and the customer(s) he represents. Return Customer Name, city, Salesman, commission.
4. Find salespeople who received commissions of more than 12 percent from the company.
5. Write a SQL query to locate those salespeople who do not live in the same city where their customers live and have received a commission of more than 12% from the company.
6. Find the details of an order. Return ord_no, ord_date, purch_amt, Customer Name, grade, Salesman, commission.
7. Display the customer name, customer city, grade, salesman, salesman city. The results should be sorted by ascending customer_id.
8. 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.
9. Join all the three tables showing everything together.
10. Write a SQL statement to join the tables salesman, customer and orders so that the same column of each table appears once and only the relational rows are returned.
 Consider the tables and write down SQL statements for the questions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!