w3resource
SQL exercises

SQL: Select order number, order date and the purchase amount for each order which will be delivered by a specified salesman

SQL Basic Select Statement : Exercise-11 with Solution.

Write a sql query to display the order number followed by order date and the purchase amount for each order which will be delivered by the salesman who is holding the ID 5001.

Sample table: orders


Sample Solution:

SELECT ord_no, ord_date, purch_amt
FROM orders
WHERE salesman_id=5001;

Output of the Query:

ord_no	ord_date	purch_amt
70002	2012-10-05	65.26
70005	2012-07-27	2400.60
70008	2012-09-10	5760.00
70013	2012-04-25	3045.60

Explanation:

Syntax of select order number, order date and the purchase amount for each order which will be delivered by a specified  salesman

Pictorial presentation :

Result of select order number, order date and the purchase amount for each order which will be delivered by a specified salesman

Query Visualization:

Duration:

Query visualization of Select order number, order date and the purchase amount for each order which will be delivered by a specified salesman - Duration

Rows:

Query visualization of Select order number, order date and the purchase amount for each order which will be delivered by a specified salesman - Rows

Cost:

Query visualization of Select order number, order date and the purchase amount for each order which will be delivered by a specified salesman - Cost

 

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a SQL statement to display all the information for those customers with a grade of 200.
Next: Write a SQL query to display the Nobel prizes for 1970.

What is the difficulty level of this exercise?



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