w3resource logo


SQL exercises

SQL Exercises: Prepare a list with order no, purchase amount, customer name and their cities for those orders which order amount between 500 and 2000.

SQL JOINS : Exercise-2 with Solution

Write a SQL statement to make a list with order no, purchase amount, customer name and their cities for those orders which order amount between 500 and 2000.

Sample Solution :

SELECT  a.ord_no,a.purch_amt,
b.cust_name,b.city 
FROM orders a,customer b 
WHERE a.customer_id=b.customer_id 
AND a.purch_amt BETWEEN 500 AND 2000;

:Explanation :

Syntax to make a list with order no, purchase amount, customer name and their cities for those orders which order amount between 500 and 2000

Pictorial presentation :

Result to make a list with order no, purchase amount, customer name and their cities for those orders which order amount between 500 and 2000

Practice Online


inventory database model

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