in our previous post we discussed how to create table in MySQL Database , lets check now how we can add more columns to existing table .
Step 1) Login to MySQL
we will be using user : demo and password as demouser
mysql -u demo -p demouser
Step 2) use database in which we need to create table , as in our previous post we created database demo we will be using same database
mysql> use demo;
Step 3) we created table employee , now we will be looking how to add more columns in existing table .lets add one more column address having data type varchar and length as 256
mysql> alter table employee add column address varchar(256) ;
Query OK, 0 rows affected (0.07 sec)
Records: 0 Duplicates: 0 Warnings: 0
here we go we can see that the table is being altered . in our next post we will be discussing how to check the existing table structure.