How to alter table in SQL?

Query By: SIRIRAT BURROWS

A

Abhijeet Kumar

Definition of Alter Table in SQL


Basically, There are three queries like ADD, DROP, and MODIFY used to Alter the table in SQL. ALTER query is used to change TABLE_NAME, COLUMN_NAME. It will work if the tables and columns are created already. Trying to mentioned SQL query syntax to alter a table below check it one by one:



ALTER TABLE -  ADD COLUMN


    ALTER TABLE table_name

    ADD column_name datatype;



ALTER TABLE - DROP COLUMN


    ALTER TABLE table_name

    DROP COLUMN  column_name;



ALTER TABLE - MODIFY COLUMN


    ALTER TABLE table_name

   MODIFY COLUMN column_name datatype;


0 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)