Joke Collection Website - Bulletin headlines - How to add new fields and set default values ??using SQL statements

How to add new fields and set default values ??using SQL statements

Use navicat to add fields and set default values ????to the mysql table.

Specific operations:

Step one: Open the navicat tool, connect to the mysql database service, as shown in the figure, you can view all tables, select one of the tables that needs to be added, and then right-click Select the design table

Step 2: On the design table page, you can see all the fields and types of the current table. The graphical tool can intuitively see the information of each field.

Step 3: Then click Add Field, a blank row will be added at the end of the table field. If you don’t want to put the newly added field at the end, you can first select a field and then click Insert Field to insert a blank row before the field you just selected.

Next, fill in the name, type, length, and whether it is empty of the field to be added in the blank line. In the two blank input boxes below, one is the default value set and the other is the comment. After filling in the information as shown in the picture, click the Save button.

Step 4: After executing the sql statement, check the table structure information. You can see that the fields just added have been correctly added to the table.