alter table cardInfo
add constraint PK_CID primary key (CID), --主键约束,CID为主键
constraint CK_CID check (CID like '1010 3576 [0-9][0-9][0-9][0-9] [0-9][0-9][0-9][0-9]'),
constraint DF_curType default ('RMB') for curType,
constraint CK_savingType check(savingType in('活期','定活两便','定期')),
constraint DF_openDate default(getDate()) for openDate, --默认约束,当天日期
constraint CK_openMoney check(openMoney>=1),
constraint CK_balance check(balance>=1),
constraint CK_pass check(len(pass)>=6),
constraint DF_pass default('888888') for pass,
constraint DF_IsReportLoss default(0) for IsReportLoss,
constraint FK_CUID foreign key(CUID) references userInfo(UID) --主外键约束,CUID为外键