Auto commit

This commit is contained in:
smallkun 2025-03-28 10:35:45 +08:00
parent 67e45ace21
commit 3fd783abc5

View File

@ -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;
```