Code Academy Flashcards

Learn SQL

1
Q

What is a statement in SQL?

A

A statement is a text that databases recognizes as a valid command

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

What is a clause in SQL?

A

Clauses perform specific tasks.

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

What is the convention for writing clauses?

A

Clauses are written in all caps

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

What is a record?

A

A record is a row in a table

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

What is a field?

A

text that the database recognizes as a valid command

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

How do you insert rows into a table?

A

INSERT INTO table_name ( field_name. field_name)

VALUES ( value, value);

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

What is the first element of starting a query?

A

SELECT

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

What is the ‘wildcard’ in SQL?

A

*

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

What does the ALTER TABLE clause allow?

A

ALTER TABLE allows the user to alter columns

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

What does
ALTER TABLE table_name
ADD COLUMN column_name DATA_TYPE;
mean?

A

The line of code creates a column of a specified data type in a specified table.

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

What is yielded after the SELECT * FROM table_name; statement?

A

The SELECT * FROM table_name; returns a new table that is called the result set.

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

What does UPDATE statement do?

A

It edits a row in a table. Its used to update existing records.

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

What does the DELETE FROM statement do?

A

It deletes one or more rows from a table.

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

What are constraints?

A

Constraints are rules that are used to specify rules for the data in the table.

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

What are primary keys?

A

Primary keys are unique to identify records so that there aren’t duplicates.

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