w3resource
SQL exercises

SQL: Using where clause with not and between operators

SQL Wildcard & Special Operator : Exercise-8 with Solution

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

Sample table: salesman


Sample Solution:

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

Output of the Query:

salesman_id	name		city		commission
5002		Nail Knite	Paris		0.13
5005		Pit Alex	London		0.11
5006		Mc Lyon		Paris		0.14
5007		Paul Adam	Rome		0.13
5003		Lauson Hen	San Jose	0.12

Explanation:

Syntax of using where clause with not and between operators

Pictorial presentation :

Result of using where clause with not and between operators

Query Visualization:

Duration:

Query visualization of Using where clause with not and between operators - Duration

Rows:

Query visualization of Using where clause with not and between operators - Rows

Cost:

Query visualization of Using where clause with not and between operators - Cost

 

Practice Online


Contribute your code and comments through Disqus.

Previous: Write a SQL statement to find those salesmen with all other information and name started with any latter within 'A' and 'K'.
Next: Write a SQL statement to find that customers whose name begin with the letter 'B'.

What is the difficulty level of this exercise?

New Exercises:R Programming