写出完成以下操作的 SQL 语句。 IS1301 (1)向student 表中插入一行数据“502001,王晓林,男,2000-02-10,广东,汉,1S2020”。 IS1301 (2)若有一新生刚入学,只收集到该生部分信息,其他信息暂时为 NULL,请使用 SET语句向student 表中插人一行数据“500102,林丽,女”。 CS1401 (3)将student 表中所有学生的地区字段的内容在原来的数据后加上“省或市”3个字。 CS1401 提示:使用MySQL字符串连接函数 CONCAT(串 1,串 2…)。 IS1401 (4)将姓名为“王一敏”的同学的出生日期改为“1998-02-10”,班级编号改为 “AC1302”。 (5)将student 表中 1997 年以前出生的学生记录删除。
时间: 2023-05-21 19:06:11 浏览: 428
1. INSERT INTO student (stuno, name, gender, birthday, region, ethnic, class) VALUES ('502001', '王晓林', '男', '2000-02-10', '广东', '汉', '1S2020');
2. INSERT INTO student (stuno, name, gender) VALUES ('500102', '林丽', '女');
3. UPDATE student SET region = CONCAT(region, '省或市');
4. UPDATE student SET birthday = '1998-02-10', class = 'AC1302' WHERE name = '王一敏';
5. DELETE FROM student WHERE YEAR(birthday) < 1997;
相关问题
写出完成以下操作的 SQL 语句。 IS1301 (1)向student 表中插入一行数据“502001,王晓林,男,2000-02-10,广东,汉,1S2020”。 IS1301 (2)若有一新生刚入学,只收集到该生部分信息,其他信息暂时为 NULL,请使用 SET语句向student 表中插人一行数据“500102,林丽,女”。 CS1401 (3)将student 表中所有学生的地区字段的内容在原来的数据后加上“省或市”3个字。 CS1401 提示:使用MySQL字符串连接函数 CONCAT(串 1,串 2…)。 IS1401 (4)将姓名为“王一敏”的同学的出生日期改为“1998-02-10”,班级编号改为 “AC1302”。 (5)将student 表中 1997 年以前出生的学生记录删除。
以下是 SQL 语句:
(1) INSERT INTO student VALUES ('502001', '王晓林', '男', '2000-02-10', '广东', '汉', '1S2020');
(2) INSERT INTO student (student_id, student_name, student_gender) VALUES ('500102', '林丽', '女');
(3) UPDATE student SET student_region = CONCAT(student_region, '省或市');
(4) UPDATE student SET student_birthday = '1998-02-10', class_id = 'AC1302' WHERE student_name = '王一敏';
(5) DELETE FROM student WHERE YEAR(student_birthday) < 1997;
相关推荐
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)