LIKE

The LIKE operator is used with the WHERE clause and searches for a string pattern in a column. The statement below will return only the rows where the "Major" is "Accounting".

SELECT Major, StartingMedianSalary FROM Degrees WHERE Major LIKE 'Accounting'

The statement below uses "%" as wildcard. So any row with a "Major" that begins with "A" will be returned--Accounting, Agriculture, Art, etc.

SELECT Major, StartingMedianSalary FROM Degrees WHERE Major LIKE 'A%'

Last updated