6 Questions
What SQL statement is used to rename a table in a database?
RENAME TABLE TABLENAME (OLD) TO ….(NEW);
Which SQL statement is used to add a new column to an existing table?
ALTER TABLE table_name ADD column_name datatype;
What SQL statement is used to change the name of a column in a table?
ALTER TABLE table_name RENAME COLUMN old_name to new_name;
What SQL statement is used to modify the data type of a column in a table?
ALTER TABLE table_name MODIFY COLUMN column_name datatype;
Which SQL statement is used to add a new column to an existing table?
ALTER TABLE - ADD Column
What SQL statement is used to rename a table in a database?
RENAME TABLE TABLENAME (OLD) TO ….(NEW);
Study Notes
SQL Table Modifications
- The
ALTER TABLE
statement is used to rename a table in a database. - The
ALTER TABLE
statement is used to add a new column to an existing table. - The
ALTER TABLE
statement with theRENAME COLUMN
clause is used to change the name of a column in a table. - The
ALTER TABLE
statement with theMODIFY
clause is used to modify the data type of a column in a table. - Note that the
ALTER TABLE
statement serves multiple purposes, including renaming tables, adding new columns, renaming columns, and modifying column data types.
Test your SQL knowledge with this quiz on renaming, adding, and modifying tables and columns. Put your skills to the test with questions on RENAME TABLE, ALTER TABLE - ADD Column, ALTER TABLE - RENAME COLUMN, and ALTER TABLE - ALTER/MODIFY DATATYPE statements.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free