KnowledgeBoat Logo

Computer Science

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. $\text{\textdollar}
  2. _
  3. ||
  4. \%

SQL Queries

1 Like

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 %.

Answered By

3 Likes


Related Questions