
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between ALTER and UPDATE Command in SQL
In this post, we will understand the difference between the ALTER command and the UPDATE command in SQL.
ALTER Command
This command is a Data Definition Language (DDL).
It performs operation at the structural level, not the data level.
This command is used to add, delete, and modify the attributes of the tables in a database.
This command, by default, initializes the values of all values in the tuple to NULL.
It changes the structure of the table.
Syntax: Add a column −
ALTER TABLE table_name ADD column_name datatype;
Drop a Column
ALTER TABLE table_name DROP COLUMN column_name;
UPDATE Command
This command is a Data Manipulation Language (DML).
It performs operations on the data level.
It updates the existing records in a database.
It sets the specified values in a tuple using the UPDATE command.
It changes the data inside the table.
Syntax:
UPDATE table_name SET column1 = value1, column2 = value2....columnN=valueN [ WHERE CONDITION ];
Advertisements