English

Ms. Ravina is using a table 'customer' with custno, name, address and phonenumber. She needs to display name of the customers, whose name start with letter 'S'.

Advertisements
Advertisements

Question

Ms. Ravina is using a table 'customer' with custno, name, address and phonenumber. She needs to display name of the customers, whose name start with letter 'S'. She wrote the following command, which did not give the result.

Select * from customer where name="S%";

Help Ms. Ravina to run the query by removing the errors and write the correct query.

Very Short Answer
Advertisements

Solution

The LIKE operator must be used instead of = for pattern matching. The % wildcard represents zero or more characters.

SELECT *
FROM customer
WHERE name LIKE 'S%';
shaalaa.com
  Is there an error in this question or solution?
Chapter 10: Structure Query Language - EXERCISE [Page 196]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 10 Structure Query Language
EXERCISE | Q 2. | Page 196
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×