Unit 3 Database - Implementation - SQL INSERT Flashcards

1
Q

What is the purpose of the INSERT query in SQL?

A

The INSERT query is used to add a row or multiple rows to a table.

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

What is the basic syntax of an INSERT query?

A

INSERT INTO table [(column1, column2, column3, ...)] VALUES (value1, value2, value3, ...);

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

What happens when you execute the following query? INSERT INTO user VALUES (7914, ‘SuperPlayer’, ‘soupRpalya’, ‘31/12/2018’);

A

A new row is added to the user table with the specified values.

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

How can you insert multiple rows at once in SQL?

A

By using a single INSERT statement with multiple sets of values, separated by commas.

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

How can you specify the column order when inserting data?

A

By explicitly listing the column names in the INSERT statement before the VALUES keyword.

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

Why is it important to ensure that column names and values match when inserting data?

A

To prevent errors and ensure data is inserted into the correct columns in the correct order.

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

What should you do after inserting data into a table?

A

Use a SELECT query to verify that the data has been added correctly.

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