Which SQL statement changes 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 SQL statement changes an existing table?

Explanation:
Changing the structure or properties of an existing table is done with ALTER TABLE. This statement lets you add, drop, or modify columns; add or drop constraints; or even rename the table. For example, you might use ALTER TABLE employees ADD COLUMN birthdate DATE; or ALTER TABLE orders MODIFY COLUMN status VARCHAR(20). The other options don’t change the table’s structure: CREATE TABLE makes a new table; DELETE FROM removes rows from a table but doesn’t alter its schema; TEXT is not a standalone SQL statement (it's typically a data type).

Changing the structure or properties of an existing table is done with ALTER TABLE. This statement lets you add, drop, or modify columns; add or drop constraints; or even rename the table. For example, you might use ALTER TABLE employees ADD COLUMN birthdate DATE; or ALTER TABLE orders MODIFY COLUMN status VARCHAR(20).

The other options don’t change the table’s structure: CREATE TABLE makes a new table; DELETE FROM removes rows from a table but doesn’t alter its schema; TEXT is not a standalone SQL statement (it's typically a data type).

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy