楼主: siciliana
跳转到指定楼层
上一主题 下一主题
收起左侧

[统计--就业] 一大波SQL面试题+solution+转换成Python/R的写法

   
🔗
吴邦毅 2019-8-14 09:02:59 | 只看该作者
全局:
Q1 sql 的正确解法. 1point3acres
.google  и


;with scope
as
(
select
'both' as channel,
customer_id,
date,
sum(spend) as Sum_2,
iif(count(channel)<2,0,count(channel)) as tot_channel
from dbo.spend
group by customer_id,
date
),Isolate
as(
select . 1point3acres
date,
channel,
max(iif(tot_channel <2,0, sum_2)) as tot_spend,
max(tot_channel) as count1. 1point3acres.com
-baidu 1point3acres
from scope.1point3acres
group by date, channel. Waral dи,

),FINAL
as(. From 1point 3acres bbs
select * from isolate
union
select
date,. 1point3acres.com
channel,
sum(spend) as tot_spend,. check 1point3acres for more.
count(customer_id) as count1
from dbo.spend
group by date, channel,customer_id
)

select ..
*
from FINAL
order by date, case when channel ='both' then'9'
                                        when channel = 'mobile' then '1'
                                        when channel = 'destop' then '2'
                                end ASC
                                       

评分

参与人数 1大米 +2 收起 理由
sclmaomao + 2 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
mikozhuzhu 2019-8-19 00:08:38 | 只看该作者
全局:
Make马克~感谢楼主!
回复

使用道具 举报

🔗
FrostGrey 2019-8-25 07:25:58 | 只看该作者
全局:
Q2 in Mysql. 1point3acres
-baidu 1point3acres
CREATE VIEW career AS
SELECT member_id, group_concat(company_name ORDER BY year_start SEPARATOR '-') AS member_career
FROM job. ----
GROUP BY member_id;
# 1)
SELECT count(*)
FROM career
WHERE member_career LIKE '%Microsoft%Google%';
# 2) . 1point 3 acres
SELECT count(*)
.google  иFROM career
WHERE member_career LIKE '%MicrosoftGoogle%';
回复

使用道具 举报

全局:
谢谢楼主分享!!!!
回复

使用道具 举报

🔗
justvic 2019-8-28 09:32:26 | 只看该作者
全局:
谢谢楼主分享,学习了
回复

使用道具 举报

🔗
牧野2013 2019-9-3 04:15:04 | 只看该作者
全局:
谢谢楼主分享!
回复

使用道具 举报

🔗
jeff256 2019-9-22 15:28:41 | 只看该作者
全局:
感谢楼主分享~手动点赞~
回复

使用道具 举报

🔗
Aleen 2019-9-24 21:17:30 | 只看该作者
全局:
Thanks for sharing!
回复

使用道具 举报

🔗
Yunfan 2019-9-25 10:03:55 | 只看该作者
全局:
赞!谢谢分享!
回复

使用道具 举报

🔗
dianayu52 2019-9-28 22:16:19 | 只看该作者
全局:
超级有用,谢谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表