Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.57/5 (3 votes)
See more:
What is the difference between alter query and update query in sql?
Posted
Updated 4-Nov-16 20:39pm

See Difference between Alter and Update SQL[^]

In short:
ALTER is used to change tables, columns etc.
UPDATE is used to change data

Cheers,
Edo
 
Share this answer
 
v3
Comments
Herbisaurus 10-Oct-13 9:38am    
5ed!
Joezer BH 6-Nov-13 2:26am    
Thank you Herb!
 
Share this answer
 
Comments
Herbisaurus 10-Oct-13 9:39am    
5ed!
Thomas ktg 10-Oct-13 9:41am    
Thanks
If it's for upcoming interviews then, it's wrong way. You should learn SQL from start.
Go here http://www.w3schools.com/sql/[^]

ALTER - make changes in Table structure.
UPDATE - make changes in Table data.
 
Share this answer
 
Comments
Herbisaurus 10-Oct-13 9:38am    
5ed!
ALTER STATEMENT
is part of Data Definition Language, is a syntax similar to a computer programming language for defining data structures, especially database schemas.

UPDATE STATEMENT
is part of Data Manipulation Language, is a family of syntax elements similar to a computer programming language used for inserting, deleting and updating data in a database.
 
Share this answer
 
UPDATE is DML used to modify existing data
ALTER IS DDL ,used to alter schema of objects like table
 
Share this answer
 
C#
UPDATE Statement is used to update/change the 
data of row(s) only, we can use certain condition(s)using WHER clause
 UPDATE <Table-Name> SET <Column-Name(s)> WHERE <Column-Name> <Condition(s)>

Example: UPDATE Student SET DepartmentName='MCA' WHERE ClassId=3

ALTER: ALTER is used alter/change the SQL Table structure
1) Alter can be used to change the table column name, column type 
2) Alter also used to add new column or contraint to the table
3) It also used to delete (drop) column or contraint from the table
 
Share this answer
 
Comments
CHill60 12-Nov-16 21:33pm    
3 years ago several (5) people posted the correct solutions. There was no need to resurrect this post without adding anything new.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900