CBSE Class 12 Computer Science Question 62 of 78

Simple Queries in SQL — Question 16

Back to all questions
16
Question

Question 16

Consider the following query

SELECT name FROM class WHERE subject LIKE ' ............... Computer Science' ;

Which one of the following has to be added into the blank space to select the subject which has Computer Science as its ending string ?

  1. $
  2. _
  3. ||
  4. %
Answer

%

Reason — The % wildcard character in SQL pattern matching, matches any substring, so %Computer Science would match any string ending with 'Computer Science'. Therefore, the correct option to fill in the blank space is %.