Data Retrieval from a Single Table Flashcards

1
Q

What are the mandatory SQL clauses in a SELECT query?

A

SELECT, FROM

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

What does the WHERE clause do?

A

Filters rows based on conditions.

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

Which operator checks if a value is in a list?

A

IN

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

What does % do in a LIKE pattern?

A

Matches any number of characters.

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

How do you check for NULL values?

A

IS NULL or IS NOT NULL

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

What does the BETWEEN operator do?

A

Checks if a value falls within a specified range.

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

How do you rename a column in a SELECT output?

A

Using an alias (AS keyword, optional).

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

What is the result of comparing anything with NULL using =?

A

Unknown (use IS NULL instead).

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

What does DISTINCT do?

A

Eliminates duplicate rows from the result.

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