标签:blog ar for strong sp div on log bs
CREATE TABLE user (
uId INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
uName VARCHAR(100) NOT NULL
);
2、创建一张从表并添加约束
create table score
{
sid int auto_increment not null primary key,
sore numeric(10,3),
uid int ,
FOREIGN KEY (uid ) REFERENCES user (uid) ON DELETE CASCADE
}
在MySQL中最重要的是:ON DELETE CASCADE 它才是一个级联的关键,然后在删除的时候主表删除外连接表自动删除包含其属性的记录
标签:blog ar for strong sp div on log bs
原文地址:http://www.cnblogs.com/dashen/p/4050497.html