Lesson 08( Table Management)
Alter Table It is used to change existing table structure such as adding or removing columns attributes etc. Syntax- alter table table_name action, [action2…..] Adding new column Drop a column Rename table describe emp2; We want to add a new column as dept. alter table emp2; → add column dept int NOT NULL → after empid; By default it will add at the end. Drop field Alter table table_name drop column_name alter emp2 → drop column dept; Rename Table Rename old table to new name like rename emp2 to emp6; Drop Table It will remove table drop table table_name; Truncate Table It will clear the table data truncate table emp6; drop table emp6 Index in Mysql An index helps in fast retrieval of data from tables. It is just like a index of book where you first search index to look for contents. All primary key column are in the primary index of the table automatically Syntax- Create index index_name on table_name column_name Deleting Index Create table emp_new3(eid, ename varchar(10))...