图1
图2
mysql插入数据语句没错但是报错,插入数据,弄不进去。图1是sql和执行的,图2是查出来的表字段上面有
图1
在test_user_two
表中添加一个名为year1
,数据类型是int
,且不可为空的字段;
执行相关sql
语句;
mysql> alter table test_user_two add year1 int not null;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>
看下表结构;
mysql> desc test_user_two;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| id | int | NO | PRI | NULL | |
| name | varchar(25) | YES | | NULL | |
| deptid | int | YES | | NULL | |
| howmoney | int | YES | | NULL | |
| year | int | YES | | NULL | |
| year1 | int | NO | | NULL | |
+----------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
mysql>