How to add a new column in mysql

To add a new column in MySQL, you can use the ALTER TABLE statement. Here is the basic syntax:

ALTER TABLE table_name
ADD COLUMN new_column_name data_type;

Here:

For example, to add a new column called age with a data type of INT to a table called users, you would use the following query:

ALTER TABLE users
ADD COLUMN age INT;

You can also specify additional options, such as:

Here are some examples:

Also, be careful when adding new columns to a table, as it can affect the performance of your queries and the data integrity of your table. It's always a good idea to back up your data before making any changes to your table structure.