What is the use of UPDATE statements in SQL? How is it different from ALTER statements?
Answers
Answered by
10
Answer:
ALTER is a DDL (Data Definition Language) statement. Whereas UPDATE is a DML (Data Manipulation Language) statement. ALTER is used to update the structure of the table (add/remove field/index etc). Whereas UPDATE is used to update data.
Answered by
1
UPDATE statement is used for modifying the existing records in a table. The UPDATE command specifies the rows to be changed using the WHERE clause and the new data using SET keywords.
Syntax: UPDATE <table name>
SET <field name>=<value or expression >
WHERE <criteria>;
UPDATE
- It modifies the existing data of a database.
- It is DML.
- It can only modify one or more records in a table.
ALTER
- It modifies existing structure of a database.
- It is DDL.
- It can add, delete or modify column of a table.
I HOPE IT IS HELPFUL FOR YOU.
PLEASE MARK ME AS A BRAINLIST
THANK YOU
Similar questions