How to Alter Table in MySQL or MariaDB by using Alter Statement
Alter table can be used to make changes to existing tables. Here are some of the scenarios we are going to cover.
How to add column to existing table :
Below syntax can be used to add column to table.
Alter table TableName
Add ColumnName datatype;
Example :
Alter table customer
add Address VARCHAR(150);
Modify Data type of Column in Table :
Let's say if you want to change the data type of a column firstname from varchar (30) to varchar (50).Alter table customer
Modify FirstName VARCHAR(50);
Drop Column from a Table in MySQL:
Let's say if you want to drop the column age from customer, you can use below statement.Alter table customer
drop column Age;
How to Add Column, Drop Column or Change Data type of a Column by using Alter Table in MySQL
Aivivu chuyên vé máy bay, tham khảo
ReplyDeletekinh nghiệm mua vé máy bay đi Mỹ giá rẻ
vé máy bay đi sài gòn vietjet
vé máy bay đi hn
giá vé máy bay hải phòng nha trang
vé máy bay đi Huế vietnam airline
dịch vụ taxi đi sân bay nội bài
combo đà nẵng