In this article, we will understand the difference between ALTER command and UPDATE
command in SQL.
This command is data definition language (DDL).
It performs operations on the structure level, not the data level.
This command is used to add, delete and modify table attributes in the database.
This command initializes the values of all values in the tuple to NULL by default.
It changes the structure of the table.
Syntax: Add column−
ALTER TABLE table_name ADD column_name datatype;
Delete a column
ALTER TABLE table_name DROP COLUMN column_name;
This command is A data manipulation language (DML).
It performs data level operations.
It updates existing records in the database.
It is using tuples of UPDATE commands.
It changes the data within the table.
Grammar:
UPDATE table_name SET column1 = value1, column2 = value2....columnN=valueN [ WHERE CONDITION ];
The above is the detailed content of The difference between ALTER and UPDATE commands in SQL. For more information, please follow other related articles on the PHP Chinese website!