sql-insert Flashcards

1
Q

How do you add a row to a SQL table?

A

insert statement,
insert into “table name” (“column name”, “column name”)
values (‘value name’, ‘value name’);

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

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

specify more than one tuple of values, separated by commas.
ex:
values (‘Ostrich Pillow’, ‘Feel comfy!’, 99, ‘self care’),
(‘Tater Mitts’, ‘Scrub some taters!’, 6, ‘cooking’)

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 clause

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