mysql建立外键表

//user
create table users(id int primary key  auto_increment not null,username varchar(50) not null,userpassword varchar(50) not null);

 

//buyer
create table buyers(buyer_id int auto_increment not null,buyers_name varchar(60) not null,buyed_goods varchar(60) not null,
	buyed_num varchar(80) not null,used_money varchar(80) not null,buyer_addr varchar(90) not null,
	foreign key(buyer_id) references users(id));
posted @ 2018-07-05 13:25  zhaocundang  阅读(1500)  评论(0编辑  收藏  举报