时间:2021-07-01 10:21:17 帮助过:4人阅读
错误是这样的:
ERROR 1005 (HY000): Can't create table 'db_database25.tb_selldetail' (errno: 150
)
建表的步骤和内容如下:
DROP TABLE IF EXISTS tb_selldetail
;
CREATE TABLE tb_selldetail
(id
int(11) NOT NULL auto_increment,
sellName
varchar(200) NOT NULL,
sellPrice
double NOT NULL,sellCount
int(11) NOT NULL,
sellTime
datetime NOT NULL,medid
int(11) default NULL,
userid
int(11) default NULL,
PRIMARY KEY (id
),
KEY FK56C63894822F277
(userid
),
KEY FK56C63894DD16E7A7
(medid
),
CONSTRAINT FK56C63894822F277
FOREIGN KEY (userid
) REFERENCES tb_user
(id
),
CONSTRAINT FK56C63894DD16E7A7
FOREIGN KEY (medid
) REFERENCES tb_medicine
(id
)
)
ENGINE=InnoDB DEFAULT CHARSET=gbk;