Alter Table Syntax

Once a table is created in the database, there are many occasions where one may wish to change the structure of the table. In general, the SQL syntax for ALTER TABLE is

ALTER TABLE "table_name"
[alter specification]

[alter specification] is dependent on the type of alteration we wish to perform. We list a number of common changes below:

  • Add Column

  • Modify Column

  • Rename Column

  • Drop Column

  • Add Index

  • Drop Index

  • Add Constraint

  • Drop Constraint
  • For all cases, examples are provided for MySQL, Oracle, and SQL Server.

    Next: SQL ADD COLUMN
    Date: Wed, May 8, 2024 9:22 PM
    Designed and Owned by MasterJosh