w3resource
SQL exercises

SQL: Using AND operator with a specified condition

SQL Boolean Operator Statement : Exercise-7 with Solution.

Write a SQL statement to display salesman_id, name, city and commission who gets the commission within the range more than 0.10% and less than 0.12%.

Sample table : salesman


Sample Solution :

SELECT salesman_id,name,city,commission 
FROM salesman 
WHERE (commission > 0.10 
AND commission< 0.12);

Output of the Query:

salesman_id	name		city	commission
5005		Pit Alex	London	0.11

Explanation :

Syntax of display  salesman_id, name, city and commission who gets the commission within the range

Pictorial presentation :

Result of display  salesman_id, name, city and commission who gets the commission within the range

Query Visualization:

Duration:

Query visualization of Using AND operator with a specified condition - Duration

Rows:

Query visualization of Using AND operator with a specified condition - Rows

Cost:

Query visualization of Using AND operator with a specified condition - Cost

 

Practice Online


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

Previous: Write a SQL statement to display either those orders which are not issued on date 2012-09-10 and issued by the salesman whose ID is 505 and below or those orders which purchase amount is 1000.00 and below.
Next: Write a SQL query to display all orders where purchase amount less than 200 or exclude those orders which order date is on or greater than 10th Feb,2012 and customer id is below 3009.

What is the difficulty level of this exercise?



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