标签:_id 外键 arc foreign incr sql use primary nbsp
SHOW DATABASES; USE db1; #drop table department; CREATE TABLE department( id INT AUTO_INCREMENT PRIMARY KEY, title CHAR(15) )ENGINE=INNODB DEFAULT CHARSET=utf8; #drop table user_info; CREATE TABLE user_info( uid BIGINT AUTO_INCREMENT PRIMARY KEY, name1 VARCHAR(32), depar_id INT )ENGINE=INNODB DEFAULT CHARSET=utf8; ALTER TABLE user_info ADD FOREIGN KEY (depar_id) REFERENCES department(id);
标签:_id 外键 arc foreign incr sql use primary nbsp
原文地址:https://www.cnblogs.com/gao-chao/p/13253348.html