w3resource

SQL Query on Multiple Tables Exercises: Find all customers with orders on October 5, 2012.

SQL Query on multiple tables : Exercise-8 with Solution

8. Write a query to display all customers with orders on October 5, 2012.

Sample table: Customer


Sample table: Orders


Sample Solution:

SELECT *
FROM customer a,orders  b 
WHERE a.customer_id=b.customer_id 
AND b.ord_date='2012-10-05';

Output of the Query:

customer_id	cust_name	city		grade	salesman_id	ord_no	purch_amt	ord_date	customer_id	salesman_id
3002		Nick Rimando	New York	100	5001		70002	65.26		2012-10-05	3002		5001
3005		Graham Zusi	California	200	5002		70001	150.50		2012-10-05	3005		5002

Explanation:

SQL Subqueries: Find all customers with orders on October 5, 2012.
Inventory database model

Contribute your code and comments through Disqus.

Previous: 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.
Next: SQL Exercises, Practice, Solution - JOINS.

What is the difficulty level of this exercise?