右下角图片

排名

用户解题统计

过去一年提交了

勋章 ①金银铜:在竞赛中获得第一二三名;②好习惯:自然月10天提交;③里程碑:解决1/2/5/10/20/50/100/200题;④每周打卡挑战:完成每周5题,每年1月1日清零。

收藏

收藏日期 题目名称 解决状态
没有收藏的题目。

评论笔记

评论日期 题目名称 评论内容 站长评论
没有评论过的题目。

提交记录

提交日期 题目名称 提交代码
2025-01-07 抖音面试真题(1)T+1日留存率 
SELECT 
t.login_date,
COUNT(DISTINCT CASE 
WHEN DATEDIFF(t.login_date, t.first_date) = 29 THEN l.usr_id 
ELSE NULL 
END) / COUNT(DISTINCT l.usr_id) AS T1_retention_rate
FROM user_login_log l
LEFT JOIN (
SELECT 
usr_id,
MIN(login_time) AS first_date,
DATE_FORMAT(MIN(login_time), '%Y-%m-%d') AS login_date
FROM user_login_log
GROUP BY usr_id
) t
ON t.usr_id = l.usr_id
GROUP BY t.login_date;
2025-01-07 曝光量最大的商品 
select p.prd_id,p.prd_nm,
sum(if(r.if_snd=1,1,0)) as exposure_count
from tb_pg_act_rcd r
left join tb_prd_map p
on r.prd_id=p.prd_id
group by p.prd_id,p.prd_nm
order by exposure_count desc 
limit 1;
2025-01-07 被收藏次数最多的商品 
SELECT 
    distinct gd.gd_id, 
    gd.gd_nm, 
    COUNT(fav.mch_id) AS fav_count
FROM 
    xhs_fav_rcd fav
left JOIN 
    gd_inf gd on fav.mch_id=gd.gd_id
GROUP BY 
    gd.gd_id, gd.gd_nm
ORDER BY 
    fav_count desc
LIMIT 1
2025-01-07 被收藏次数最多的商品 
SELECT 
    distinct gd.gd_id, 
    gd.gd_nm, 
    COUNT(fav.mch_id) AS fav_count
FROM 
    xhs_fav_rcd fav
left JOIN 
    gd_inf gd on fav.mch_id=gd.gd_id
GROUP BY 
    gd.gd_id, gd.gd_nm
ORDER BY 
    fav_count
LIMIT 1
2025-01-07 被收藏次数最多的商品 
SELECT 
    distinct gd.gd_id, 
    gd.gd_nm, 
    COUNT(fav.mch_id) AS fav_count
FROM 
    xhs_fav_rcd fav
JOIN 
    gd_inf gd 
GROUP BY 
    gd.gd_id, gd.gd_nm
ORDER BY 
    fav_count
LIMIT 1
2025-01-07 被收藏次数最多的商品 
SELECT 
    gd.gd_id, 
    gd.gd_nm, 
    COUNT(fav.fav_trq) AS fav_count
FROM 
    xhs_fav_rcd fav
JOIN 
    gd_inf gd 
GROUP BY 
    gd.gd_id, gd.gd_nm
ORDER BY 
    fav_count
LIMIT 1
2024-11-05 招建银行信用卡中心客户挽留-电商平台分类 
select merchant_name,
		CASE 
WHEN merchant_name LIKE '%小红书%' OR merchant_name LIKE '%行吟信息科技' THEN '小红书'
WHEN merchant_name LIKE '%拼多多%' OR merchant_name LIKE '%上海寻梦信息技术%'THEN '拼多多'
WHEN merchant_name LIKE '%京东%' OR merchant_name LIKE '%网银在线%' OR merchant_name LIKE '%京东平台商户%' THEN '京东'
WHEN merchant_name LIKE '%抖音生活服务商家%' OR merchant_name LIKE '%合众易宝%' OR merchant_name LIKE '%格物致品网络科技%' OR merchant_name LIKE '%成都所见所得科技%' OR merchant_name LIKE '%北京空间变换科技%' THEN '抖音'
WHEN merchant_name LIKE '%淘宝%' OR merchant_name LIKE '%天猫%' OR merchant_name LIKE '%杭州今日卖场%' THEN '淘系'
ELSE '其他'end as platform
from (select distinct mch_nm as merchant_name from ccb_trx_rcd) t
2024-11-05 德州扑克起手牌-最强起手牌KK+ 
select *
from hand_permutations
where 
    concat(card1, card2) like '%A%A%' or
    concat(card2, card1) like '%A%K%' or
    concat(card1, card2) like '%K%K%' or
    concat(card1, card2) like '%K%A%'
order by id;
2024-11-05 德州扑克起手牌-同花 
select 
    sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2 as cnt 
    , count(1)/2 as ttl_cnt 
    ,cast(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2/(count(1)/2) AS DECIMAL(4,3)) as p 
from hand_permutations
2024-11-05 德州扑克起手牌-同花 
select 
    sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2 as cnt 
    , count(1)/2 as ttl_cnt 
    ,cast(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2/count(1)/2 AS DECIMAL(4,4)) as p 
from hand_permutations
2024-11-05 德州扑克起手牌- 手对 
select *
from hand_permutations
where 
    left(card1, 1) = left (card2, 1)
order by id;
2024-11-05 德州扑克起手牌- A花 
select *
from hand_permutations
where 
    right(card1, 1) = right(card2, 1)
    and 
    (card1 like 'A%' or card2 like 'A%')
order by id;
2024-11-05 德州扑克起手牌- A花 
select *
from hand_permutations
where 
    right(card1, 1) = right(card2, 1)
    and 
    card1 like 'A%' or card2 like 'A%'
order by id;
2024-11-04 德州扑克起手牌-同花 
select 
    round(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2,0) as cnt 
    , round(count(1)/2,0) as ttl_cnt 
    ,round((sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2)/(count(1)/2),3) as p 
from hand_permutations
2024-11-04 德州扑克起手牌-同花 
select 
    round(sum(case when left(card1,1)=left(card2,1) then 1 else 0 end)/2,0) as cnt 
    , round(count(1)/2,0) as ttl_cnt 
    ,round((sum(case when left(card1,1)=left(card2,1) then 1 else 0 end)/2)/(count(1)/2),3) as p 
from hand_permutations
2024-11-04 德州扑克起手牌-同花 
select 
    round(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2,1) as cnt 
    , round(count(1)/2,1) as ttl_cnt 
    ,round((sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2)/(count(1)/2),1) as p 
from hand_permutations
2024-11-04 德州扑克起手牌-同花 
select 
    round(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2,0) as cnt 
    , round(count(1)/2,0) as ttl_cnt 
    ,round((sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2)/(count(1)/2),1) as p 
from hand_permutations
2024-11-04 德州扑克起手牌-同花 
select 
    round(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2,0) as cnt 
    , round(count(1)/2,0) as ttl_cnt 
    ,round(sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2/count(1)/2,3) as p 
from hand_permutations
2024-11-04 德州扑克起手牌-同花 
select 
    sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2 as cnt 
    , count(1)/2 as ttl_cnt 
    ,sum(case when right(card1,1)=right(card2,1) then 1 else 0 end)/2/count(1)/2 as p 
from hand_permutations
2024-11-04 德州扑克起手牌- 手对 
select *
from hand_permutations
where 
    left(card1, 1) = LEFT(card2, 1)
order by id;