代码拉取完成,页面将自动刷新
CREATE DATABASE IF NOT EXISTS tedushop CHARSET = UTF8;
USE tedushop;
CREATE TABLE IF NOT EXISTS user_profile
(
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '用户id',
username VARCHAR(20) UNIQUE COMMENT '用户名',
password VARCHAR(80) COMMENT '密码',
email VARCHAR(255) COMMENT '邮箱',
created TIMESTAMP COMMENT '注册时间'
) CHARSET = UTF8;
CREATE TABLE IF NOT EXISTS user_address
(
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '地址id',
receiver VARCHAR(20) COMMENT '收件人',
phone CHAR(11) COMMENT '手机号',
address VARCHAR(100) COMMENT '地址',
user_profile_id BIGINT,
FOREIGN KEY (user_profile_id) REFERENCES user_profile (id)
) CHARSET = UTF8;
INSERT INTO user_profile(id, username, password, email, created)
VALUES (1, '张楚岚', '123456', '123@qq.com','2000-08-09 00:00:00'),
(2, '冯宝宝', '123456', '321@qq.com','2000-04-05 00:00:00'),
(3, '张灵玉', '123456', '456@qq.com','2000-12-05 00:00:00'),
(4, '张之维', '123456', '789@qq.com','1990-04-03 00:00:00');
SELECT *FROM user_profile;
INSERT INTO user_address(id, receiver, phone, address, user_profile_id)
VALUES (1,'张楚岚','18312345678','上海',1),
(2,'冯宝宝','18298765432','北京',2),
(3,'张灵玉','15523459876','天津',3),
(4,'张之维','15523456789','天津',4);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。