0
0
DBMS Theoryknowledge~10 mins

Rename operation in DBMS Theory - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to rename a table from old_table to new_table.

DBMS Theory
ALTER TABLE old_table [1] new_table;
Drag options to blanks, or click blank then click option'
ARENAME TO
BUPDATE TO
CMODIFY TO
DCHANGE TO
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'CHANGE TO' or 'MODIFY TO' instead of 'RENAME TO'.
Forgetting the 'TO' keyword after 'RENAME'.
2fill in blank
medium

Complete the code to rename a column old_column to new_column in the table my_table.

DBMS Theory
ALTER TABLE my_table [1] old_column new_column VARCHAR(50);
Drag options to blanks, or click blank then click option'
AUPDATE COLUMN
BRENAME COLUMN
CMODIFY COLUMN
DCHANGE COLUMN
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'RENAME COLUMN' which is not supported in all SQL dialects.
Omitting the data type when renaming a column.
3fill in blank
hard

Fix the error in the code to rename a table from users to customers.

DBMS Theory
ALTER TABLE users [1] customers;
Drag options to blanks, or click blank then click option'
ACHANGE TO
BRENAME TO
CMODIFY TO
DUPDATE TO
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'CHANGE TO' which is incorrect for renaming tables.
Forgetting the 'TO' keyword after 'RENAME'.
4fill in blank
hard

Fill both blanks to rename a column address to location with type VARCHAR(100) in the table employees.

DBMS Theory
ALTER TABLE employees [1] address [2] location VARCHAR(100);
Drag options to blanks, or click blank then click option'
ACHANGE COLUMN
BRENAME COLUMN
CTO
DAS
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'RENAME COLUMN' which is not supported in all SQL dialects.
Using 'AS' instead of 'TO' between column names.
5fill in blank
hard

Fill all three blanks to rename a table orders to sales_orders and rename column order_date to sale_date with type DATE.

DBMS Theory
ALTER TABLE [1] [2] sales_orders; ALTER TABLE sales_orders [3] order_date sale_date DATE;
Drag options to blanks, or click blank then click option'
Aorders
BRENAME TO
CTO
DCHANGE COLUMN
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of commands.
Using incorrect keywords like 'MODIFY' instead of 'CHANGE COLUMN'.