SQL ALTER TABLE

The ALTER TABLE statement in SQL is used to modify the structure of an existing table. It can be used to add, modify, or delete columns, constraints, and indexes.

Syntax:

Example:

In this example, the ALTER TABLE statement is used to add a new column manufacturer to the cars table. The column is of type VARCHAR(255), which means it can store string values up to 255 characters in length.

Note: The syntax for the ALTER TABLE statement may vary depending on the SQL database management system you are using.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top