读书人

oracle建表时出现缺失右括号有关问题

发布时间: 2012-09-09 09:27:54 作者: rapoo

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行出现右括号缺失错误。
请大家帮忙找一下是哪里错了。
谢谢。



[解决办法]

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));
[解决办法]
结贴给分 多看下基础的语法 多敲敲 熟悉记忆的快
[解决办法]
呵呵,新手上路 可以理解。
[解决办法]
探讨
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……

读书人网 >oracle

热点推荐