SQL ALTER TABLE is a versatile command that allows you to modify the structure of an existing database table. It enables you to add, modify, or delete columns, as well as apply constraints to your tables. Let's break down the key functionalities of SQL ALTER TABLE:

1. Adding Columns

Adding new columns to an existing table is a common task when your database evolves. Instead of creating a new table from scratch, you can use SQL ALTER TABLE command to add one or more columns effortlessly to table. Here's the syntax:

ALTER TABLE table_name ADD column_name column-definition;

For instance, suppose you have a table named Van and want to add a Van_Model column. You can achieve this with the following SQL statement:

ALTER TABLE Cars ADD Car_Model VARCHAR(20);

2. Modifying Columns

Sometimes, you may need to alter the properties of an existing column, such as changing its data type or size. The SQL ALTER TABLE statement can handle this too:

ALTER TABLE table_name MODIFY column_name column-definition;

For example, let's say you want to change the data type of the Van_Color column in the Van table:

ALTER TABLE Van MODIFY Van_Color VARCHAR(50);

3. Deleting Columns

When certain data becomes no longer relevant or useful, you might want to remove columns from your table. SQL ALTER TABLE can help you do that without affecting the entire table:

ALTER TABLE table_name DROP COLUMN column_name;

Suppose you decide to remove the Van_Color column from the Van table:

ALTER TABLE Van DROP COLUMN Van_Color;

4. Renaming Columns

Changing the name of a column is another operation you can perform with SQL ALTER TABLE. It's particularly useful for improving the clarity of your database structure:

ALTER TABLE table_name RENAME COLUMN old_name TO new_name;

Let's assume you want to rename the Van_Color column to Colors in the Van table:

ALTER TABLE Cars RENAME COLUMN Car_Color TO Colors;