Chinaunix首页 | 论坛 | 博客
  • 博客访问: 20251
  • 博文数量: 14
  • 博客积分: 433
  • 博客等级: 下士
  • 技术积分: 145
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-16 23:07
文章分类

全部博文(14)

文章存档

2012年(14)

最近访客

分类: Mysql/postgreSQL

2012-03-06 20:01:16

  1. create table person
  2.  ( id char(10),
  3.  age smallint,
  4.  name char(10),
  5.  spouse char(10),
  6.  primary key(id),
  7.  foreign key(spouse) references person(id) on delete set null on update cascade,
  8.  check(age>0));
  9. //key(attr1) references table(attr2)要注意,delete,update针对attr2
阅读(1736) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~