牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共175篇)
题解 | #购买行为分析#
这是统计全表计算类的聚合函数,sum(求和),avg(平均值),max(最大值),min(最小值),count(计数)这几类很常用 计算前面distinct 去重计算,列多次出现,只算1次 select count(distinct 顾客ID) as "购买人数", sum(销售...
2024-06-28
1
201
题解 | #重命名列名#
此题,考的是别名,在列的后面加上as空格和别名名称 select 列名 as 别名名称 from 表名 select 用户id,商品id,用户行为类型,地理位置,购买行为发生的时间 as "用户交易时间" from 用户购买记录表
2024-06-28
0
189
题解 | #分析访客浏览行为#
这道题是考去重的,去重有几种方式1.distinct 列名直接去重 2.group by 分组去重 第一组 distinct 去重 select 访客id,浏览日期 from 用户行为表 group by 访客id,浏览日期 第二组 group by 去重 select 访客id,浏览日期 fro...
2024-06-28
0
221
题解 | #查找空值#
基础的select 列名,列名 from 表名 where 条件null 比较特殊,要用 is null 含null,或者 is not null 不含null select 教师号, 教师姓名 from 教师表 where 教师姓名 is null
2024-06-28
0
222
题解 | #查找非空值#
select 教师号, 教师姓名 from 教师表 where 教师姓名 is not null 基础的select 列名,列名 from 表名 where 条件null 比较特殊,要用 is null 含null,或者 is not null 不含null
2024-06-28
0
265
题解 | #得分不小于平均分的最低分#
select min(t.score) as min_score_over_avg from( select ed.exam_id,score, avg(score)over(partition by exam_id) as pg from exam_record ed left join ex...
2024-06-11
0
230
题解 | #实习广场投递简历分析(三)#
with tiaojian as ( select job, date_format(date,"%Y-%m") as month, month(date) as com, sum(num) as cnt from resume_info where year(date)=2...
2024-03-26
1
273
题解 | #有取消订单记录的司机平均评分#
#小白好理解的写法 with tiaojian as ( select driver_id from tb_get_car_order //求出有取消记录的司机 where start_time is null and date_format(order_time,"...
2024-03-21
1
244
题解 | #连续签到领金币#
#小白另类解法,好理解,请大牛多多指教 with tiaojian as ( select uid, artical_id, date(in_time) as day, lead(date(in_time),1)over(partition by uid order by date(in_time)...
2024-03-20
1
351
题解 | #每天的日活数及新用户占比#
#简单的判断思路解题,排序判断uid排名第一的登录的时间,再利用case进行判断 with tiaojian as ( select uid, date(in_time) as day from tb_user_log group by uid,day union all select uid, ...
2024-03-20
1
274
首页
上一页
4
5
6
7
8
9
10
11
12
13
下一页
末页