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".
The statement below uses "%" as wildcard. So any row with a "Major" that begins with "A" will be returned--Accounting, Agriculture, Art, etc.
Use "LIMIT" at the end to return only a defined number of rows from the top of the result. It is often used with "ORDER BY" like below.
The WHERE clause is used to filter records based on a condition. The following SQL statement will return a table that only contains rows where the "StartingMedianSalary" is greater than 60000.
You can use the following operators for the comparison.
Operator
Description
=
Equal
<>
Not equal.
>
Greater than
<
Less than
>=
Greater than or equal
<=
Less than or equal
The "ORDER BY" keyword simply sorts the rows of the table based on the column name provided. You can follow the ORDER BY columnName
with "ASC" or "DESC" (for ascending or descending) to dictate the direction of the sort.