Which statement fragment is used to add a new column to an existing table?

Study for the SQL Basics Test. Improve your knowledge with multiple choice questions and detailed explanations. Prepare effectively to master SQL concepts!

Multiple Choice

Which statement fragment is used to add a new column to an existing table?

Explanation:
When you want to extend a table's structure, you use an ALTER TABLE statement. The part that brings in a new column is ADD COLUMN, followed by the column name and its data type. This exact fragment is what you’ll see in standard syntax: ALTER TABLE table_name ADD COLUMN column_name data_type. For example, ALTER TABLE employees ADD COLUMN birthdate DATE;. Some dialects let you write ADD without COLUMN, but ADD COLUMN clearly signals that you’re introducing a new column. The phrases INSERT COLUMN and APPEND COLUMN aren’t valid SQL for modifying a table’s schema.

When you want to extend a table's structure, you use an ALTER TABLE statement. The part that brings in a new column is ADD COLUMN, followed by the column name and its data type. This exact fragment is what you’ll see in standard syntax: ALTER TABLE table_name ADD COLUMN column_name data_type. For example, ALTER TABLE employees ADD COLUMN birthdate DATE;. Some dialects let you write ADD without COLUMN, but ADD COLUMN clearly signals that you’re introducing a new column. The phrases INSERT COLUMN and APPEND COLUMN aren’t valid SQL for modifying a table’s schema.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy