Filter Queries, Operators, and Wildcards Flashcards

1
Q

What do SELECT DISTINCT statements do?

A

return unique values by filtering out duplicates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the basic SELECT DISTINCT statement format?

A

SELECT DISTINCT column_name FROM table_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do WHERE statements do?

A

filter result set to include ONLY row that meet the following conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the basic WHERE statement format?

A

SELECT * FROM table_name WHERE column_name condition;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do operators do?

A

symbols that create a condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are 6 operators and their symbol?

A

= Equals
!= Not Equals
> Greater Than
= Greater Than or Equal To

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do LIKE statements do?

A

return similar values for comparison

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the basic LIKE statement format?

A

SELECT * FROM table_name WHERE column_name LIKE value;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What do wildcard characters do?

A

donate that any character can be placed in the location without breaking the pattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the _ wildcard character do?

A

Allows any one character to replace the symbol

Example, ‘Se_en’ could return “Seven” or “Se7en”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the % wildcard character do?

A

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’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do BETWEEN statements do?

A

return the results between two values, when used with WHERE statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the basic BETWEEN statement format?

A

SELECT * FROM table_name WHERE column_name BETWEEN value AND value;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do AND statements do?

A

join conditions for a query; all conditions must be true for a row to show for the query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do OR statements do?

A

join conditions for a query; one or more conditions must be true for a row to show for the query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do ORDER BY statements do?

A

indicate that a column should be sorted alphabetically or numerically

17
Q

What do DESC statements do?

A

indicate sorting a column in descending order, when used with ORDER BY

18
Q

What do ASC statements do?

A

indicate sorting a column in ascending order, when used with ORDER BY

19
Q

What do LIMIT statements do?

A

limit the results by a certain number

i.e., top 3 results or first 10 rows