Sapna Malik
How to add a new column to an existing table?
By Sapna Malik in Databases & DBA on May 24 2011
  • Sanjeev Kumar
    Jul, 2016 27

    Alter Table Tablename Add columnname datatype

    • 0
  • Rahul Prajapat
    May, 2015 27

    alter table table_name add column_name data_type

    • 0
  • Jiteendra Sampathirao
    May, 2011 25

    SQL: ALTER TABLE emp ADD DateOfBirth date

    To insert the new column after a specific column, such as name, use this statement:

    MySQl:

    ALTER TABLE abc ADD empname  VARCHAR(60) AFTER deptname;

    If you want the new column to be first, use this statement:
    ALTER TABLE abc ADD empname VARCHAR(60) FIRST;

    Renaming a table
    ALTER TABLE abc RENAME TO xyz

    • 0
  • Sapna Malik
    May, 2011 24

    SQL> Alter table table_name (id number, name varchar2(20));

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS