SQL-Insert Flashcards

1
Q

How do you add a row to a SQL table?

A

By using the INSERT INTO statement followed by the table name in double quotes. After that a list of comma separated column names within parentheses. On the next line use the VALUES statement followed by a list of comma separated column values within parentheses

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

What is a tuple?

A

a list of values is referred to as a tuple.

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

How do you add multiple rows to a SQL table at once?

A

to add multiple values, you would use the VALUES statement followed by multiple list of values each inside their own set of parentheses

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

How do you get back the row being inserted into a table without a separate select statement?

A

use the RETURNING statement with an * to return all created rows

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