文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>外键测试

外键测试

时间:2007-02-17  来源:PHP爱好者

DROP TABLE IF EXISTS child;
DROP TABLE IF EXISTS parent;DROP TABLE IF EXISTS child;
DROP TABLE IF EXISTS parent;# creat table start
create table parent
(
par_id int not null,
primary key (par_id)
) type = innodb;
create table child
(
par_id int not null,
child_id int not null,
primary key (par_id,child_id),
foreign key (par_id) references parent (par_id) on delete cascade
) type = innodb;# creat table end # insert stratinsert into parent (par_id) values (1),(2),(3);
insert into child (par_id,child_id) values (1,1),(1,2);
insert into child (par_id,child_id) values (2,1),(2,2),(2,3);
insert into child (par_id,child_id) values (3,1);# insert end
php爱好者 站 http://www.phpfans.net 网页制作|网站建设|数据采集.
相关阅读 更多 +
排行榜 更多 +
我的武侠梦手游下载

我的武侠梦手游下载

角色扮演 下载
快乐连连看下载免费版

快乐连连看下载免费版

休闲益智 下载
泛滥死者布道手机版下载

泛滥死者布道手机版下载

角色扮演 下载