WHAT IS THE USE OF ALTER TABLE COMMAND IN DATABASE?

Sanjay Sharma

Total Post:42

Points:210
Posted by  Sanjay Sharma
 1266  View(s)
Ratings:
Rate this:
  1. Pushpendra Singh

    Post:241

    Points:1205
    What is the use of Alter Table command in database?

    The ALTER table command is used to add, delete, or modify columns in an existing table.

    To add a column in a table, use the following syntax:

    ALTER TABLE table_name
    ADD column_name datatype

  1. Chris S

    Post:23

    Points:115
    What is the use of Alter Table command in database?

    The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table.

    Use of ALTER command in database

    Alter command is used for change the column name, add column, add constraint, and change the datatype.

    Syntax: Add Column name

    ALTER TABLE table_name
    ADD column_name datatype

    Syntax: Delete a Column

    ALTER TABLE table_name
    DROP COLUMN column_name

    Syntax: Change Column Name

    ALTER TABLE table_name
    ALTER COLUMN column_name datatype

      Modified On Mar-21-2016 06:47:35 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!