---添加主键约束   
Alter Table stuInfo   
Add Constraint  PK_stuNO primary Key(stuNo)   
---添加唯一约束   
Alter Table stuInfo   
Add Constraint UQ_stuID unique(stuID)   
---添加默认约束   
Alter Table stuInfo   
Add Constraint DF_stuAddress default('地址不详') for stuAddress   
---添加检查约束   
Alter Table stuInfo   
Add Constraint CK_stuAge check(stuAge between 15 and 40)   
---添加外键约束   
Alter Table stuMarks   
Add Constraint FK_stuNo foreign key(stuNo) references stuInfo(stuNo) 

相关文章:

  • 2021-12-13
  • 2021-08-01
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2021-06-12
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-11-17
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案