0% found this document useful (0 votes)
199 views4 pages

SQL Practice

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 4

Profession board web application

Occupation board web application

Career board web application

Job board management system

Apni Rozee web based Job portal

Foodino_ Food at your door step

Food free truck web application

Delicious Food Order web application

Food delivery management system

1. Write a query to find those customers with their name and those salesmen with their name and
city who lives in the same city. Go to the editor

Sample table: salesman

salesman_id name city commission


----------- ---------- ---------- ----------
5001 James Hoog New York 0.15
5002 Nail Knite Paris 0.13
5005 Pit Alex London 0.11
5006 Mc Lyon Paris 0.14
5003 Lauson Hen 0.12
5007 Paul Adam Rome 0.13

Sample table: customer


customer_id cust_name city grade
salesman_id
----------- ------------ ---------- ----------
-----------
3002 Nick Rimando New York 100
5001
3005 Graham Zusi California 200
5002
3001 Brad Guzan London
5005
3004 Fabian Johns Paris 300
5006
3007 Brad Davis New York 200
5001
3009 Geoff Camero Berlin 100
5003
3008 Julian Green London 300
5002
3003 Jozy Altidor Moscow 200
5007

Click me to see the solution with pictorial presentation

2. Write a SQL statement to find the names of all customers along with the salesmen who works
for them. Go to the editor

Sample table: customer

Sample table: salesman

Click me to see the solution with pictorial presentation

3. Write a SQL statement to display all those orders by the customers not located in the same
cities where their salesmen live. Go to the editor

Sample table: salesman


Sample table: customer

Sample table: orders

Click me to see the solution with pictorial presentation

4. Write a SQL statement that finds out each order number followed by the name of the
customers who made the order. Go to the editor

Sample table: orders

Sample table: customer

Click me to see the solution with pictorial presentation

5. Write a SQL statement that sorts out the customer and their grade who made an order. Each of
the customers must have a grade and served by at least a salesman, who belongs to a city. Go
to the editor

Sample table: salesman

Sample table: customer

Sample table: orders

Click me to see the solution with pictorial presentation

6. Write a query that produces all customers with their name, city, salesman and commission,
who served by a salesman and the salesman works at a rate of the commission within 12% to
14%. Go to the editor
Sample table: salesman

Sample table: customer

Click me to see the solution with pictorial presentation

7. Write a SQL statement that produces all orders with the order number, customer name,
commission rate and earned commission amount for those customers who carry their grade is
200 or more and served by an existing salesman. Go to the editor

Sample table: salesman

Sample table: customer

Sample table: orders

Click me to see the solution with pictorial presentation

You might also like