SQL Basics - 2 Flashcards

More basic SQL lessons.

1
Q

Why should you use capitalization and indentation in SQL?

A

To make your queries easier to read and troubleshoot.

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

What does a semicolon do at the end of a SQL statement?

A

It terminates the statement (part of the ANSI SQL-92 standard).

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

Does every SQL database require a semicolon at the end of a statement?

A

No, not all databases enforce the semicolon.

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

What does the WHERE clause do in SQL?

A

It narrows the query to return data that meets specific conditions.

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

What is the percent sign % used for in a SQL query?

A

It is a wildcard to match one or more characters. Example: WHERE field1 LIKE ‘Ch%’;

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

What happens if you use SELECT * in a query?

A

It selects all columns in the table.

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

Why should you be cautious using SELECT *?

A

It can select too much data, slowing down the query.

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

How do you add a comment in SQL?

A

Use -- for single-line comments or /* */ for multi-line comments.

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

What is the purpose of comments in SQL?

A

To describe the query and help others understand it.

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

What does <> mean in SQL?

A

“Does not equal.”

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

Why is SQL powerful for a data analyst?

A

It enables quick access to data for insights and decision-making.

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