MySQL Worksheet 3 : RENAME Commands for Class XII and Class XI



MySQL Worksheet 3 : RENAME Commands

Here’s a worksheet focused specifically on the RENAME commands in MySQL, tailored for Class XII students. This worksheet includes various types of questions to help reinforce understanding



Name: ___________________
Date: ___________________

Part A: Multiple Choice Questions

  1. Which command is used to rename a table in MySQL?

    • a) RENAME TABLE
    • b) ALTER TABLE ... RENAME
    • c) CHANGE TABLE
    • d) MODIFY TABLE
  2. To rename a column in an existing table, which command would you use?

    • a) ALTER COLUMN
    • b) RENAME COLUMN
    • c) ALTER TABLE ... CHANGE
    • d) MODIFY TABLE ... RENAME
  3. The syntax to rename a table from "OldTable" to "NewTable" is:

    • a) RENAME TABLE OldTable TO NewTable;
    • b) ALTER TABLE OldTable RENAME TO NewTable;
    • c) CHANGE TABLE OldTable TO NewTable;
    • d) MODIFY TABLE OldTable AS NewTable;

Part B: True/False Questions

  1. T/F: You can rename multiple columns in a single ALTER TABLE command.

  2. T/F: After renaming a table, all associated foreign keys automatically update to reflect the new name.

  3. T/F: The RENAME command can be used to change the name of a database.

Part C: Fill in the Blanks

  1. The SQL command to rename a table named "Students" to "Pupils" is __________.

  2. To rename a column "LastName" to "Surname" in the "Employees" table, you would use __________.

  3. The keyword used to specify the new name in the RENAME command is __________.

Part D: Short Answer Questions

  1. Write the SQL command to rename the table "Orders" to "CustomerOrders".

  2. Write the SQL command to change the column name "Address" to "HomeAddress" in the "Customers" table.

  3. Explain the importance of using the RENAME command in database management.

Part E: Practical Application

  1. Write a command to rename the table "Products" to "Inventory".

  2. Write a command to rename the column "PhoneNumber" to "ContactNumber" in the "Contacts" table.

  3. If you want to rename a database from "OldDatabase" to "NewDatabase", what command would you use?


Post a Comment

0 Comments