mysql> create table ss
-> (
-> no int check(no <= 4 and no >=
-> );
Query OK, 0 rows affected (0.11 sec)mysql> insert into ss values(1);
Query OK, 1 row affected (0.01 sec)mysql> select * from ss;
+------+
| no |
+------+
| 1 |
+------+
1 row in set (0.00 sec)mysql> insert into ss values(5);
Query OK, 1 row affected (0.03 sec)mysql> select * from ss;
+------+
| no |
+------+
| 1 |
| 5 |
+------+
2 rows in set (0.00 sec)
-> (
-> no int check(no <= 4 and no >=
-> );
Query OK, 0 rows affected (0.11 sec)mysql> insert into ss values(1);
Query OK, 1 row affected (0.01 sec)mysql> select * from ss;
+------+
| no |
+------+
| 1 |
+------+
1 row in set (0.00 sec)mysql> insert into ss values(5);
Query OK, 1 row affected (0.03 sec)mysql> select * from ss;
+------+
| no |
+------+
| 1 |
| 5 |
+------+
2 rows in set (0.00 sec)
创建表的时候是 no int check(no <= 4 and no >= 1
2楼是对的
( stuId varchar(30) primary key,
stuName nvarchar(50) not null,
stuSex nchar(1) checck(stuSex in('男','女')) default '男',
stuAge int check(stuAge>1),
stuJg nvarchar(30),
stuDept nvarchar(40))用mysql怎么建立一样性质的这样的表。。用naviate写滴 怎么写 把具体步骤告诉我 谢谢高手 我邮箱 [email protected] 谢谢啦 thank you!