w3resource
SQL exercises

SQL Subquery Exercises: Find all customers with orders on October 5, 2012

SQL SUBQUERY : Exercise-9 with Solution

9. 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';

Sample Output:

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

Practice Online


Inventory database model

Query Visualization:

Duration:

Query visualization of Find all customers with orders on October 5, 2012 - Duration

Rows:

Query visualization of Find all customers with orders on October 5, 2012 - Rows

Cost:

Query visualization of Find all customers with orders on October 5, 2012 - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to count the customers with grades above New York's average.
Next: Write a query to display all the customers with orders issued on date 17th August, 2012.

What is the difficulty level of this exercise?



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