SQL Update Flashcards
1
Q
How do you update rows in a database table?
A
“update” & “set” statements is a means of updating rows in a database table.
update “products”
set “price” = 100
where “productId” = 24;
Great care must be taken to include a where clause in your update statements to only target specific rows
2
Q
Why is it important to include a where clause in your update statements?
A
If you didn’t specify the row to be updated with the ‘where’ clause, then the update would update every row in the table