SET FOREIGN_KEY_CHECKS=0;
-- Table structure for trade
DROP TABLE IF EXISTS trade
;
CREATE TABLE trade
(tradeid
int(11) NOT NULL AUTO_INCREMENT,tradename
varchar(100) DEFAULT NULL,tradeprice
varchar(100) DEFAULT NULL,
PRIMARY KEY (tradeid
) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- Records of trade
INSERT INTO trade
VALUES ('1', '紫金苑A栋101', '001');
INSERT INTO trade
VALUES ('2', '紫金苑A栋102', '002');
INSERT INTO trade
VALUES ('3', '紫金苑A栋103', '003');
INSERT INTO trade
VALUES ('5', '紫金苑A栋104', '004');
-- Table structure for user
DROP TABLE IF EXISTS user
;
CREATE TABLE user
(user_id
int(11) NOT NULL AUTO_INCREMENT,user_name
varchar(100) DEFAULT NULL,user_pwd
varchar(100) DEFAULT NULL,
PRIMARY KEY (user_id
) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- Records of user
INSERT INTO user
VALUES ('1', 'xiaoniucr', '1');
INSERT INTO user
VALUES ('2', 'zhangsan', '1');
INSERT INTO user
VALUES ('3', 'lisi', '1');
INSERT INTO user
VALUES ('4', 'wangwu', '1');
主键都是int类型,数据插入时,是字符类型。
INSERT INTO trade VALUES (1, '紫金苑A栋101', '001');
INSERT INTO trade VALUES (2, '紫金苑A栋102', '002');
INSERT INTO trade VALUES (3, '紫金苑A栋103', '003');
INSERT INTO trade VALUES (5, '紫金苑A栋104', '004');
INSERT INTO user VALUES (1, 'xiaoniucr', '1');
INSERT INTO user VALUES (2, 'zhangsan', '1');
INSERT INTO user VALUES (3, 'lisi', '1');
INSERT INTO user VALUES (4, 'wangwu', '1');
user表里面的id是int类型
你插入的时候是varchar类型