SQL Subquery Exercises: Display all the orders for the salesman who belongs to the city London
SQL SUBQUERY: Exercise-2 with Solution
2. Write a query to display all the orders for the salesman who belongs to the city London.
Sample table: Salesman
Sample table: Orders
SELECT * FROM orders WHERE salesman_id = (SELECT salesman_id FROM salesman WHERE city='London');
Output of the Query:
ord_no purch_amt ord_date customer_id salesman_id 70009 270.65 2012-09-10 3001 5005
Contribute your code and comments through Disqus.
Previous: Write a query to display all the orders from the orders table issued by the salesman 'Paul Adam'.
Next: Write a query to find all the orders issued against the salesman who works for customer whose id is 3007.
What is the difficulty level of this exercise?
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework