w3resource
SQL exercises

SQL: Using where clause with between operator

SQL Wildcard & Special Operator : Exercise-7 with Solution

Write a SQL statement to find those salesmen with all other information and name started with any letter within 'A' and 'K'.

Sample table: salesman


Sample Solution:

SELECT *
FROM salesman
WHERE name BETWEEN 'A' and 'L';

Output of the Query:

salesman_id	name		city		commission
5001		James Hoog	New York	0.15

Explanation:

Syntax of using where clause with between operator

Pictorial presentation :

Result of using where clause with between operator

Query Visualization:

Duration:

Query visualization of Using where clause with between operator - Duration

Rows:

Query visualization of Using where clause with between operator - Rows

Cost:

Query visualization of Using where clause with between operator - Cost

 

Practice Online


Contribute your code and comments through Disqus.

Previous: Write a query to filter all those orders with all information which purchase amount value is within the range 500 and 4000 except those orders of purchase amount value 948.50 and 1983.43.
Next: Write a SQL statement to find those salesmen with all other information and name started with other than any latter within 'A' and 'L'.

What is the difficulty level of this exercise?



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