If you want to add a column in a table but as first row, do as follow:
alter table table_name add column first;
example:
alter table EXAMPLE add column NAME varchar(15) first;
If you want to add a column in a table but as first row, do as follow:
alter table table_name add column first;
example:
alter table EXAMPLE add column NAME varchar(15) first;
If you want to load data into a table from a local file, do as follow:
load data local infile ” into table table_name fields terminated by ” lines terminated by ”;
example:
load data local infile ‘/input/data’ into table TEMPLATE fields terminated by ‘,’ lines terminated by ‘\n’;
To rename a column from an existing table, run the following command:
alter table table_name change old_column_name new_column_name attribute;
example:
alter table EXAMPLE change ONE TWO varchar(25);
To insert records from table to another, run the following command:
insert into table_name select fields1,field2…from table_name;
example:
mysql> insert into EXAMPLE select FIRST,LAST from TEST;
To insert records from table to another without duplicate, run the following command:
insert ignore into table_name select fields1,field2… from table_name;
example:
mysql> insert ignore into EXAMPLE select FIRST,LAST from TEST;
To create a table from another without data, run the following command:
create table new_table_name like source_table_name;
example:
mysql> create table EXAMPLE like SOURCE;