1. Add a column

Adding a new column involves a change in the TABLE structure, so ALTER TABLE tells the database that a change in the TABLE structure level is involved.

The new column is then added via ADD.

In addition, you need to specify the data type of the new field. For example, the following data type is vARCHAR (10) and the variable length is 10.

ALTER TABLE da_club_user_model ADD car_gear varchar(10)
Copy the code

2. Change the column name

If you want to change the names of columns in an existing TABLE, ALTER TABLE also tells the database about changes involving the TABLE structure level.

The field name is then changed by changing COLUMN.

ALTER TABLE da_club_user_model CHANGE COLUMN rzSpec preSpec VARCHAR(100)
Copy the code

👏👏👏 take a look at our previous article 😃😃😃 🌺 Excel data analysis tool library – correlation coefficient 🌺 dry goods, hand in hand to teach you to do correlation analysis 🌺 5 years of data analysis road, summary. 🌺 user segmentation and portrait analysis 🌺 K-nearest neighbor algorithm and practice

Welcome to our wechat official account.Home of data analysts

Scan the QR code to follow us

💁 provides career planning, resume guidance, interview counseling services

QQ communication group: 254674155