oracle建表时出现缺失右括号有关问题
oracle建表时出现缺失右括号问题
create table students
(
stuID number primary key,
stuName varchar2(20),
stuSex char(2) check(stuSex='男' or stuSex='女') default('男'),
stuAge number(3) check(stuAge between 0 and 100) default(0),
stuCity varchar2(20),
classID number(4)
constraint students_fk foreign key(classID) references classes(classID)
);
第5行出现右括号缺失错误。
请大家帮忙找一下是哪里错了。
谢谢。
------解决方案--------------------
create table students
(
stuID number primary key,
stuName varchar2(20),
stuSex char(2) check(stuSex='男' or stuSex='女') default('男'),
stuAge number(3) check(stuAge between 0 and 100) default(0),
stuCity varchar2(20),
classID number(4)
constraint students_fk foreign key(classID) references classes(classID)
);
第5行出现右括号缺失错误。
请大家帮忙找一下是哪里错了。
谢谢。
------解决方案--------------------
- SQL code
create table students ( stuID number primary key, stuName varchar2(20), stuSex char(2) default('男') check(stuSex='男' or stuSex='女'), stuAge number(3) default(0) check(stuAge between 0 and 100), stuCity varchar2(20), classID number(4), constraint students_fk foreign key(classID) references classes(classID) );
------解决方案--------------------
结贴给分 多看下基础的语法 多敲敲 熟悉记忆的快
------解决方案--------------------
呵呵,新手上路 可以理解。
------解决方案--------------------