sql-update Flashcards

1
Q

How do you update rows in a database table?

A

“UPDATE” statement:

UPDATE table_name
SET column1 = value1, column2 = value2, …
WHERE some_column = some_value;

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

Why is it important to include a where clause in your update statements?

A

It is important to include a “WHERE” clause in your update statements because without it, the update statement will modify all rows in the table, which could result in unintended data changes or loss.

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