日期:2014-05-19  浏览次数:20413 次

为什么这里老是提示有语法错误啊!!!!
create   table   员工信息表  
(员工编号   int   not   null   constraint   c1   primary   key,
  员工姓名   char(10)   not   null,
  出生日期   date   not   null,
  性别   char(2)   not   null,
  文化程度   char(10)   null   ,
  婚否   char(4)   not   null   constraint   c2   check(婚否   =   '未婚 '   or   婚否   =   '已婚 '),
  constraint   c3   unique(出生日期,文化程度),
  constraint   c4   default   '未知 '   for   文化程度    
  )
在c4约束时老是提示我for附近有语法错误,真是奇怪拉.我是按讲座上作的啊.谁能指点一下?!

------解决方案--------------------
create table 员工信息表
(员工编号 int not null constraint c1 primary key,
员工姓名 char(10) not null,
出生日期 datetime not null,
性别 char(2) not null,
文化程度 char(10) null default '未知 ',
婚否 char(4) not null constraint c2 check(婚否 = '未婚 ' or 婚否 = '已婚 '),
constraint c3 unique(出生日期,文化程度)
)