w3resource
SQL exercises

SQL Subquery Exercises: Display the commission of all the salesmen servicing customers in Paris

SQL SUBQUERY : Exercise-6 with Solution

6. Write a query to display the commission of all the salesmen servicing customers in Paris.

Sample table: Salesman


Sample table : Customer


Sample Solution:

SELECT commission
FROM salesman
WHERE salesman_id IN
    (SELECT salesman_id 
     FROM customer
     WHERE city = 'Paris');

Sample Output:

commission
0.14

Practice Online


Inventory database model

Query Visualization:

Duration:

Query visualization of Display the commission of all the salesmen servicing customers in Paris - Duration

Rows:

Query visualization of Display the commission of all the salesmen servicing customers in Paris - Rows

Cost:

Query visualization of Display the commission of all the salesmen servicing customers in Paris - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to find all orders attributed to a salesman in New york.
Next: Write a query to display all the customers whose id is 2001 bellow the salesman ID of Mc Lyon.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming