w3resource
SQL exercises

SQL: Using where clause with like operator

SQL Wildcard & Special Operator : Exercise-9 with Solution

Write a SQL statement to find that customers whose name begin with the letter 'B'.

Sample table: customer


Sample Solution :

SELECT *
FROM customer
WHERE cust_name LIKE 'B%';

Output of the Query:

customer_id	cust_name	city		grade	salesman_id
3007		Brad Davis	New York	200	5001
3001		Brad Guzan	London			5005

Explanation :

Syntax of using where clause with like operator

Pictorial presentation :

Result of using where clause with like operator

Query Visualization:

Duration:

Query visualization of Using where clause with like operator - Duration

Rows:

Query visualization of Using where clause with like operator - Rows

Cost:

Query visualization of Using where clause with like operator - 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 other than any latter within 'A' and 'L'.
Next: Write a SQL statement to find all those customers with all information whose names are ending with the letter 'n'.

What is the difficulty level of this exercise?