qfedu-linux-advanced-level/day9/homework/h3.sql

40 lines
1023 B
MySQL
Raw Normal View History

2023-08-24 21:54:42 +08:00
/*
loginperson表中插入3条记录
*/
-- 进入bookdb数据库
use bookdb;
-- 向login表中插入数据
INSERT INTO login
VALUES
(1001, '张三', 'zspasswd', '2021-08-29 12:30:23', '2023-06-05 23:10:23'),
(1002, '李四', 'lspasswd', '2022-08-29 12:30:23', '2023-07-05 21:10:23'),
(1003, '王五', 'wwpasswd', '2023-04-29 12:30:23', '2023-06-14 23:23:23');
-- 向person表中插入数据
INSERT INTO person
VALUES
(1001, '张三', '三三', '', '/path/to/head1.jpg', '12345678901'),
(1002, '李四', '四四', '', '/path/to/head2.jpg', '12345678902'),
(1003, '王五', '五五', '', '/path/to/head3.jpg', '12345678903');
-- 显示login表中数据
SELECT
login_id AS '登录编号',
name AS '登录名',
passwd AS '密码',
create_time AS '注册时间',
last_time AS '最近登录时间'
FROM login;
-- 显示person表中数据
SELECT
login_id AS '登录编号',
real_name AS '真实姓名',
nick_name AS '昵称',
sex AS '性别',
head AS '头像路径',
phone AS '手机号'
FROM person;