Filter Queries, Operators, and Wildcards Flashcards
What do SELECT DISTINCT statements do?
return unique values by filtering out duplicates
What is the basic SELECT DISTINCT statement format?
SELECT DISTINCT column_name FROM table_name;
What do WHERE statements do?
filter result set to include ONLY row that meet the following conditions
What is the basic WHERE statement format?
SELECT * FROM table_name WHERE column_name condition;
What do operators do?
symbols that create a condition
What are 6 operators and their symbol?
= Equals
!= Not Equals
> Greater Than
= Greater Than or Equal To
What do LIKE statements do?
return similar values for comparison
What is the basic LIKE statement format?
SELECT * FROM table_name WHERE column_name LIKE value;
What do wildcard characters do?
donate that any character can be placed in the location without breaking the pattern
What does the _ wildcard character do?
Allows any one character to replace the symbol
Example, ‘Se_en’ could return “Seven” or “Se7en”
What does the % wildcard character do?
Any number of characters can replace the symbol, so long as the value ends or begins with the correct character
Example, ‘a%’ could return ‘apple’ or ‘Andrew’
Example 2, ‘%man%’ could return ‘man’, ‘Manitoba’, or ‘woman’
What do BETWEEN statements do?
return the results between two values, when used with WHERE statements
What is the basic BETWEEN statement format?
SELECT * FROM table_name WHERE column_name BETWEEN value AND value;
What do AND statements do?
join conditions for a query; all conditions must be true for a row to show for the query
What do OR statements do?
join conditions for a query; one or more conditions must be true for a row to show for the query