SQL Statements Flashcards
What is does the UNION key word do?
UNION - combines the result of two or more select statements. Both select statements must have the same number of columns and they must be similar data types.
What does the IN keyword do?
IN - specify multiple values in a where clause. Checks if the value is in the list of values provided. Can also provide a list of values by passing a select column from another table.
What does the BETWEEN key word do?
BETWEEN - selects values within a given range, begin and end values included.
Name the wildcard character
% - zero or more characters _ - single character [] - any single character within the brackets ^ any character not in the brackets - single character in a given range
What would ‘WHERE Value LIKE ‘a%’’ return?
any values that start with a
What would ‘WHERE Value LIKE ‘%a’’
any values that end with a
What would “WHERE Value LIKE ‘_r%’” return?
any values that have r in second position