arrow
arrow
arrow
Which of the following SQL commands is used to modify the structure of a table?
Question

Which of the following SQL commands is used to modify the structure of a table?

A.

Alter

B.

Modify

C.

Update

D.

More than one of the above

E.

None of the above

Correct option is A

The ALTER SQL command is used to modify the structure of an existing table in a database. This command allows you to add, delete, or modify columns in an existing table. You can also rename the table or change the data type of columns using ALTER.
Important Key Points:
1. ALTER Command: The ALTER command is specifically used to make structural changes to a table, such as adding or removing columns, changing column data types, or renaming columns or the table itself.
2. Add, Drop, and Modify: The ALTER command can be used with various clauses such as ADD, DROP, and MODIFY to manipulate the table structure. For example, ADD adds new columns, DROP removes columns, and MODIFY changes the data type of a column.
3. Data Integrity: When using the ALTER command to modify the structure of a table, it's important to ensure that the changes will not affect existing data or relationships between tables.
4. Table Renaming: The ALTER command can also be used to rename an entire table using the RENAME clause.
Knowledge Booster:
· Modify: The MODIFY command is not a standalone SQL command; it is used in conjunction with the ALTER command to change the data type or properties of a column.
· Update: The UPDATE command is used to modify the data within the rows of a table, not the structure of the table.

Free Tests

Free
Must Attempt

CDP Subject Test 01

languageIcon English
  • pdpQsnIcon20 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon20 Mins
languageIcon English
Free
Must Attempt

EVS Subject Test 01

languageIcon English
  • pdpQsnIcon20 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon20 Mins
languageIcon English
Free
Must Attempt

CTET Paper-I PYP (07 July 2024)

languageIcon English
  • pdpQsnIcon150 Questions
  • pdpsheetsIcon150 Marks
  • timerIcon150 Mins
languageIcon English
test-prime-package

Access ‘BPSC TRE (11-12)’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
263k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow