Menu

SQL Alter Statement


To add, delete, or modify columns in an existing table. The ALTER TABLE statement is used.

SQL ALTER TABLE Syntax

To add a column in a table, the syntax is

ALTER TABLE table_name
ADD column_name datatype

To delete a column in a table, the syntax is

ALTER TABLE table_name
DROP COLUMN column_name

To change the data type of a column in a table, the syntax is

ALTER TABLE table_name
ALTER COLUMN column_name datatype

To change the data type of a column in a table My SQL / Oracle (prior version 10G):

ALTER TABLE table_name
MODIFY COLUMN column_name datatype

To change the data type of a column in a table Oracle 10G and later:

ALTER TABLE table_name
MODIFY column_name datatype







Connection failed: SQLSTATE[28000] [1045] Access denied for user 'studentdb'@'localhost' (using password: YES)

Subscribe