...
Database-Management-System
August 29, 2024
Database-Management-System
August 29, 2024
Database-Management-System
August 29, 2024
Database-Management-System
August 29, 2024

Database-Management-System

Question 648
Consider a “CUSTOMERS” database table having a column “CITY” filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have “GAR” somewhere in its name, is:
A
Select * from customers where
city = ‘%GAR%’;
B
Select * from customers where
city = ‘$GAR$’;
C
Select * from customers where
city like ‘%GAR%’;
D
Select * from customers where
city as ‘%GAR’;
Question 648 Explanation: 
In above question a specific pattern “GAR” is given for pattern matching.
In SQL “LIKE” clause is used for pattern matching. For LIKE clause we have two wild cards:
1. “%” which represents any sequence of “0” or more characters.
2. “_” is used to replace a single character.
So, Option C is the correct answer because they have used LIKE clause along with “%” which indicates any number of character can be present before and after “GAR” pattern.
Correct Answer: C
Question 648 Explanation: 
In above question a specific pattern “GAR” is given for pattern matching.
In SQL “LIKE” clause is used for pattern matching. For LIKE clause we have two wild cards:
1. “%” which represents any sequence of “0” or more characters.
2. “_” is used to replace a single character.
So, Option C is the correct answer because they have used LIKE clause along with “%” which indicates any number of character can be present before and after “GAR” pattern.

Leave a Reply

Your email address will not be published. Required fields are marked *