Master_zx
Master_zx
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
Master_zx的博客
全部文章
(共89篇)
题解 | #创建一张新表#
create table if not exists user_info_vip( id int primary key auto_increment ...
Mysql
2022-09-12
0
327
题解 | #删除记录(三)#
本题的要点如下:1、删除表中所有数据;2、重置自增键 首先一个思路是使用truncate,Truncate是一个能够快速清空资料表内所有资料的SQL语法。并且能针对具有自动递增值的字段,做计数重置归零重新计算的作用。 truncate table nowcoder_ex...
Mysql
2022-09-12
0
271
题解 | #删除记录(二)#
本题思路较前一题主要增加了对特定位置数据的删除,需进一步使用limit函数: delete from exam_record where timestampdiff(minute,start_time,submit_time) <&nbs...
Mysql
2022-09-11
0
237
题解 | #删除记录(一)#
delete from exam_record where timestampdiff(minute,start_time,submit_time) < 5 and score < 60...
Mysql
2022-09-11
0
251
题解 | #更新记录(一)#
更新记录使用update ... ,如有限定条件,则使用where即可 update examination_info set tag = 'Python' where tag = 'PYTHON'
Mysql
2022-09-09
0
260
题解 | #插入记录(三)#
由于原表中已存在需要插入的记录,因此不能直接插入数据,这里有两种,第一种是使用replace into ... 的做法,即使用新数据替换原有的数据: replace into examination_info values(0,9003,'SQL','hard',90,'20...
Mysql
2022-09-09
0
0
题解 | #插入记录(二)#
一个tip从评论区学到的:由于新表的id字段是自增类型的,所以源表的id不能直接插入,只需插入除id之外的字。 insert into exam_record_before_2021 (select null,uid,exam_id,start_time,...
Mysql
2022-09-09
0
277
题解 | #插入记录(一)#
实话说关于mysql的数据插入不是很熟,平时不怎么见到这种题目,现学现用: insert into exam_record(uid,exam_id,start_time,submit_time,score) values(1001, 9001, '2021-09-01 22:11:12', '2...
Mysql
2022-09-09
0
280
题解 | #纠错4#
排序操作在查询操作完成后再进行 (SELECT cust_name, cust_contact, cust_email FROM Customers WHERE cust_state = 'MI')&n...
Mysql
2022-09-09
0
225
题解|#组合产品名称和顾客名称#
本题感觉就一个小点,使用union查询时用来连接的两表字段需要保持一致,因此将Customers表中的cust_name改成prod_name,再进行union查询即可。 (select prod_name from Products) union // 联合去...
Mysql
2022-09-09
6
563
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页