www大王叫我来巡山
www大王叫我来巡山
全部文章
分类
题解(31)
归档
标签
去牛客网
登录
/
注册
www大王叫我来巡山的博客
全部文章
(共18篇)
题解 | #浙大不同难度题目的正确率#
关键点知识点多表合并及计算正确率(需要流程空值函数) select difficult_level, (sum(case when question_practice_detail.result = 'right' then 1 else 0 end) / count(question_practi...
Mysql
2022-06-18
0
164
题解 | #SQL类别高难度试卷得分的截断平均值#
必须注意聚合分数时直接avg会提示出错 select tag, difficulty, round((sum(score) - max(score) - min(score)) / (count(score) - 2), 1) as clip_avg_score from exam_record j...
Mysql
2022-05-28
0
127
题解 | #创建一张新表#
level 注意用``,而不是用‘’ CREATE TABLE IF NOT EXISTS user_info_vip ( id int PRIMARY KEY AUTO_INCREMENT COMMENT '自增ID', uid int UNIQUE NOT NULL COMMENT '用户ID'...
Mysql
2022-05-14
0
150
题解 | #删除记录(二)#
关注limit 取值 delete from exam_record where timestampdiff(minute,start_time,submit_time) < 5 or submit_time is null order by start_time limit 3
Mysql
2022-05-14
0
118
题解 | #删除记录(一)#
知识点:delete from 表名 where 删除条件 开始时间与结束时间只差 delete from exam_record where timestampdiff(minute,start_time,submit_time)<5 and score <60
Mysql
2022-05-14
0
152
题解 | #更新记录(二)#
update set 字段1=修改值,字段2=修改值... 筛选条件日期20210901之前且分数为空值(未答完) update exam_record set submit_time = '2099-01-01 00:00:00',score = 0 where start_time <'2...
Mysql
2022-05-14
0
128
题解 | #插入记录(一)#
insert into exam_record (uid, exam_id, start_time, submit_time, score)value (1001,9001,'2021-09-01 22:11:12','2021-09-01 23:01:12',90), (1002,9002,'20...
Mysql
2022-05-06
0
135
题解 | #纠错4#
行连接后,再排序 SELECT cust_name, cust_contact, cust_email FROM Customers WHERE cust_state = 'MI' UNION SELECT cust_name, cust_contact, cust_email FROM Custo...
Mysql
2022-05-02
0
130
题解 | #将两个 SELECT 语句结合起来(一)#
select prod_id,quantity from OrderItems where quantity = 100 union all select prod_id,quantity from OrderItems where prod_id like "BNBG%" order by pro...
Mysql
2022-05-02
0
116
题解 | #返回产品名称和每一项产品的总订单数#
#outer join 等于left join union right join 思路: select A.prod_name,count(A.order_num) orders from (select prod_name,order_num from Products left join Ord...
Mysql
2022-04-24
0
151
首页
上一页
1
2
下一页
末页