Which command is used to change the structure of an existing table in SQL?

Which command is used to change the structure of an existing table in SQL?

a) ALTER
b) MODIFY
c) UPDATE
d) INSERT

Answer:

a) ALTER

Explanation:

The ALTER command in SQL is used to modify the structure of an existing table. It can be used to add, delete, or modify columns, as well as to add or drop constraints such as primary keys or foreign keys.

For example, ALTER TABLE employees ADD email VARCHAR(50) would add a new column named “email” to the “employees” table.

ALTER is commonly used when changes need to be made to the database schema without affecting the data stored in the table.

Reference:

Database Management System MCQ (Multiple Choice Questions)

Leave a Comment

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

Scroll to Top