MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Correct syntax query syntax to drop a column from a table is
A
DELETE COLUMN column ____ name;
B
DROP COLUMN column ____ name;
C
ALTER TABLE table ____ name DROP COLUMN column ____ name;
D
None is correct.
Explanation: 

Detailed explanation-1: -Syntax. The syntax to drop a column in a table in MySQL (using the ALTER TABLE statement) is: ALTER TABLE table name DROP COLUMN column name; table name.

Detailed explanation-2: -First, write ALTER TABLE, followed by the name of the table you want to change (in our example, product ). Next add the DROP COLUMN clause, followed by the name of the column you want to remove (in our example, description ). This removes the column from the table, including any data stored in it.

Detailed explanation-3: -Step 1: Go to the Databases-> Tables menu and expand it. Step 2: Select the desired table and expand it. Step 3: Select the Columns and expand them. Step 4: Right-click on the column name you want to remove and choose the Delete option.

Detailed explanation-4: -In Object Explorer, right-click the table from which you want to delete columns and choose Design. Right-click the column you want to delete and choose Delete Column from the shortcut menu.

There is 1 question to complete.