Add a Column: To add a new column to an existing table:
ALTER TABLE table_name ADD column_name datatype;
Example
ALTER TABLE employees ADD email VARCHAR2(100);
Modify a Column: To change the datatype or constraints of an existing column:
ALTER TABLE table_name MODIFY column_name new_datatype;
Example
ALTER TABLE employees MODIFY salary NUMBER(10, 2);
Drop a Column: To remove a column from a table:
ALTER TABLE table_name DROP COLUMN column_name;
Example
ALTER TABLE employees DROP COLUMN email;
Leave a Reply