Master_zx
Master_zx
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
Master_zx的博客
全部文章
(共87篇)
题解 | #删除记录(二)#
本题思路较前一题主要增加了对特定位置数据的删除,需进一步使用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
题解 | #将两个 SELECT 语句结合起来(二)#
本题主要是考察条件中的逻辑关系使用,此题使用“或”逻辑解答,题解如下: select prod_id,quantity from OrderItems where substring(prod_id,1,4) = "BNBG" ...
Mysql
2022-09-09
0
267
题解 | #将两个 SELECT 语句结合起来(一)#
本题思路同样是采用union联合查询,思路清晰简单,代码如下: (select prod_id,quantity from OrderItems where quantity = 100) // 查询数量为100的产品i...
Mysql
2022-09-09
0
519
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页