Question 10Asked in UGC NET Computer Science, December 2015 (Paper II & III, Selected Questions)

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…

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 :
  1. ASelect * from customers where city = '%GAR%';
  2. BSelect * from customers where city = '$GAR$'
  3. CSelect * from customers where city like '%GAR%';
  4. DSelect * from customers where city as '%GAR'
Show answerHide answer

Correct answer: (C) Select * from customers where city like '%GAR%';

Explanation

The LIKE operator with the % wildcard matches any sequence of characters: Select * from customers where city like '%GAR%';

From UGC NET Computer Science PYQ, December 2015 (Paper II & III, Selected Questions)

This is question 10 of UGC NET Computer Science PYQ, December 2015 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.