From 3fd783abc5c2c1cc3496414ef33e902d2b4ccab9 Mon Sep 17 00:00:00 2001 From: smallkun Date: Fri, 28 Mar 2025 10:35:45 +0800 Subject: [PATCH] Auto commit --- 3月调考/MySQL.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/3月调考/MySQL.md b/3月调考/MySQL.md index 598f46b..57deb92 100644 --- a/3月调考/MySQL.md +++ b/3月调考/MySQL.md @@ -545,5 +545,40 @@ SET FOREIGN_KEY_CHECKS = 1; ### 答案 ```sql +#1 +CREATE TABLE t_teacher( + id INT(8) PRIMARY KEY, + `name` VARCHAR(10), + nikename VARCHAR(20), + introduce text +); + +#2 +INSERT INTO t_student() +VALUES(10101, '王梓星', 'username123', 'password123'); + +#3 +DELETE FROM t_course +WHERE id = 10004; + +#4 +UPDATE t_video v +SET v.link = 'www.shipin.mp4' +WHERE v.id = 10005; + +#5 tj11 +SELECT COUNT(*) 'total_students' +FROM t_student; + +#6 +SELECT v.id '视频编号', v.title '标题', v.link '链接地址' +FROM t_video v, t_course c +WHERE v.c_id = c.id AND c.`name` = '语文'; + +#7 +CREATE VIEW v_education AS +SELECT s.`name` '学生姓名', c.`name` '课程名称', l.`schedule` '学习进度', l.createtime '创建时间' +FROM t_student s, t_learn l, t_course c +WHERE s.id = l.s_id AND l.c_id = c.id; ```