Advertisements
Advertisements
Question
Write any two differences between UPDATE and ALTER TABLE commands of MySQL.
Distinguish Between
Solution
The following are the main differences between MySQL's UPDATE and ALTER TABLE commands:
S. No. | UPDATE | ALTER TABLE |
1. | Use the UPDATE command to change already-existing records or rows in a table. It modifies the values of one or more columns in rows that already exist. | A table's structure can be changed using the ALTER TABLE command. It lets you change, add, or remove constraints, indexes, columns, and other table elements. |
2. | Within a table, the UPDATE command functions at the row level. | Table-level operations are carried out with the ALTER TABLE command. |
3. | The UPDATE command can be used with the WHERE clause. | The ALTER command cannot be used with the WHERE clause. |
shaalaa.com
Is there an error in this question or solution?