deɪbreɪk
deɪbreɪk
全部文章
分类
题解(15)
归档
标签
去牛客网
登录
/
注册
deɪbreɪk的博客
全部文章
(共14篇)
题解 | #月均完成试卷数不小于3的用户爱作答的类别#
# 先找大于3次的UID select tag, count(start_time) as tag_cnt from exam_record inner join examination_info using (exam_id) where uid in (sel...
2022-07-05
5
168
题解 | #禁止重复注册#
current_users = ['Niuniu', 'Niumei', 'GurR', 'LOLO'] new_users = ['GurR', 'Niu Ke Le', 'LoLo', 'Tuo Rui Chi'] #新列表,将字母全部转换成小写 current_users_up = [_.lo...
Python3
2022-06-07
0
260
题解 | #考试分数(二)#
select id,a.job,score from grade as a join (select job, avg(score) as avgs from grade group by job )as b on a.job=b.job w...
Mysql
2022-06-05
0
119
题解 | #程序员节#
users_list=['Niuniu','Niumei' ,'Niu Ke Le'] for i in users_list: print(f'Hi, {i}! Welcome to Nowcoder!' ) print('Happy Programmers\' Day to everyon...
Python3
2022-06-02
0
183
题解 | #牛客每个人最近的登录日期(二)#
-- sql执行的顺序:from--where--group by/having-聚合-select-order by 将字段改为* group by 之后,日期不是最大日期 所以用子查询,先查询出对应ID的最大日期 select u.name,c.name,l2.m_date from logi...
Mysql
2022-05-30
0
207
题解 | #异常的邮件概率#
select date ,round(sum( case type when 'completed' then 0 else 1 end )/count(date),3) -- 如果成功就是0,不成功就是...
Mysql
2022-05-30
0
141
题解 | #统计salary的累计和running_total#
select emp_no,salary,sum(salary) over (order by emp_no) from salaries where to_date = '9999-01-01' -- sum(a) over (order by b) 的含义是:按照b列排序,将a依次相加...
Mysql
2022-05-30
0
127
题解 | #获取有奖金的员工相关信息。#
一:case when then else end select e.emp_no,e.first_name,e.last_name,em.btype ,s.salary, -- 直接输出的字段 (case btype when 1 then s.salary*0.1 ...
Mysql
2022-05-29
0
147
题解 | #使用含有关键字exists查找未分配具体部门的员工的所有信息。#
select * from employees -- 全部查询 where not exists ( -- 不包含 select emp_no...
Mysql
2022-05-29
0
207
题解 | #使用子查询的方式找出属于Action分类的所有电影对应的title,description#
select title,description from film as fi where fi.film_id in-- 结果是一列数据,要用in (select fc.film_id from film_category as fc where category_id in -- 得到电影...
Mysql
2022-05-27
0
123
首页
上一页
1
2
下一页
末页