separated by comma. For example to update multiple fields in the Student table, the command is given as: UPDATE Student SET Age= , Place = ‘Chennai’ WHERE Admno = ; Akshith M Chennai The above command modifies the record in the following way. Admno Name Gender Age Place Ashish M Chennai Adarsh M Delhi Akshith M Chennai Ayush M Delhi . .
Some Additional DDL Commands: . . . ALTER COMMAND The ALTER command is used to alter the table structure like adding a column, renaming the existing column, change the data type of any column or size of the column or delete the column from the table.
It is used in the following way : ALTER TABLE <table-name> ADD <column-name><data type><size>; 12th Computer Chapter - - Structured Query Language To add a new column “Address” of type ‘char’ to the Student table, the command is used as ALTER TABLE Student ADD Address char; To modify existing column of table, the ALTER TABLE command can be used with MODIFY clause like wise: ALTER TABLE <table-name> MODIFY<column-name><data type><size>; ALTER TABLE Student MODIFY Address char ( ); The above command will modify the address column of the Student table to now hold characters. The ALTER command can be used to rename an existing column in the following way : ALTER TABLE <table-name> CHANGE old-column-name new-column-name new column definition; For example to rename the column Address to City, the command is used as : ALTER TABLE Student CHANGE Address City char( ); The ALTER command can also be used to remove a column or all columns, for example to remove a particular column, the DROP COLUMN is used with the ALTER TABLE to remove a particular field. The command can be used as: ALTER TABLE <table-name> DROP COLUMN <column-name>; To remove the column City from the Student table, the command is used as : ALTER TABLE Student DROP COLUMN City; . .
. TRUNCATE command The TRUNCATE command is used to delete all the rows from the table, the structure remains and the space is freed