- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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.
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;
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.
UPDATE table_name SET column1 = value1, column2 = value2....columnN=valueN [ WHERE CONDITION ];
- Related Articles
- What is the use of update command in SQL?
- Difference between SQL and PL/SQL
- Difference Between SQL and T-SQL
- Difference between Static SQL and Dynamic SQL
- Difference Between T-SQL and PL-SQL
- What is the difference between the New-AZTag and Update-AZTag command in Azure PowerShell?
- Difference between SQL and NoSQL
- Difference between SQL(Structured Query Language) and T-SQL(Transact-SQL).
- Difference between Join and union in SQL
- Difference Between COMMIT and ROLLBACK in SQL
- Difference Between DELETE and DROP in SQL
- Difference between MySQL and SQL Server
- Difference between Oracle and SQL Server
- Difference between DELETE and DROP SQL
- Difference between ETL and ELT in SQL Server