Add column query in mysql

Add column query in mysql

Okay everyone Now we will learn how to add columns to the MySQL table, so here Suppose we already have a table then we add a column, yes.

Let's just open the XAMPP application here I try to enter MySQL, yes here I try to use the sales_database database.

Okay here we try to see the table first

Suppose there is a table with the name product_table we see the structure first with the command desc product_table

So here there is a product column product ID name price product category and stock here I will give an example of adding a column with the name expired_date the data type is date

How to:
alter table then followed by the table name product table then add column what is the name of the column expired date for example then the data type did like that semicolon query Okay so this is a query Okay then let's see, yes we see the results after being added with the describe command again Describe product table so like this this is the column we just added okay that's all for this tutorial Thank you and see you guys

 

Tutorial video about how to add column query in MySQL

 

Conclusion

 Add column expired_date by type:

ALTER TABLE product_table
    ADD COLUMN expired_data date;

0 Response to "Add column query in mysql"

Posting Komentar