注册 登录
编程论坛 MySQL论坛

请教大家

faint_路漫漫 发布于 2008-05-07 20:44, 1412 次点击
mysql> alter table holiday
    -> modify customerid int not null;//约束为not null   
Query OK, 2 rows affected (0.06 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> insert into holiday(bookingid,destination) values(3,'guangzhou');//为什么这里还能输入为NULL;请高手帮助。。。。。谢谢`~`
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select *from holiday;
+------------+-----------+-------------+
| customerid | bookingid | destination |
+------------+-----------+-------------+
|          1 |         1 | beijing     |
|          0 |         1 | shanghai    |
|          0 |         3 | guangzhou   |
+------------+-----------+-------------+
3 rows in set (0.00 sec)

mysql>
0 回复
1