MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In existing table, ALTER TABLE statement is used to
A
Add columns
B
Add constraints
C
Delete columns
D
Delete constrains
E
All the above
Explanation: 

Detailed explanation-1: -The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. The ALTER TABLE statement is also used to add and drop various constraints on an existing table.

Detailed explanation-2: -The basic syntax of an ALTER TABLE command to change the DATA TYPE of a column in a table is as follows. ALTER TABLE table name MODIFY COLUMN column name datatype; The basic syntax of an ALTER TABLE command to add a NOT NULL constraint to a column in a table is as follows.

Detailed explanation-3: -ALTER TABLE table name MODIFY COLUMN column name datatype; Hence the correct answer is ALTER.

Detailed explanation-4: -The ALTER command in SQL is used to make changes to a table, view, or the entire database. We can add, modify, and drop constraints, columns, and indexes using the ALTER command in SQL.

Detailed explanation-5: -Adding a Column If you need to add a column to the table you’ve created, one that was not specified in the original schema, you can use an ADD COLUMN clause in an ALTER TABLE statement.

There is 1 question to complete.