項目背景
項目思路
項目解決方案部分展示
1、不同表之間的關聯圖
該項目涉及太多的表,我們第一步就是要弄清楚不同表之間的聯繫。
2、相關數據集介紹
3、項目完整的可執行SQL
你是否寫過超過100行的SQL代碼呢?或者說,寫出過這麼多有關聯的SQL呢?趕緊學習起來吧!
比如用車消費能力,這裏腳本太長只展示一部分:
use ccdb;
-- 創建臨時表
DROP TEMPORARY TABLE IF EXISTS d_type_user_tmp;
CREATE TEMPORARY TABLE user_layer_tmp
select * from
(
select 'A類用戶' as user_type, '大於等於3單用戶' as details, one_user_cnt as user_cnt from c_type_user_tmp
union all
select 'B類用戶' as user_type, '等於2單用戶' as details, two_user_cnt as user_cnt from b_type_user_tmp
union all
select 'C類用戶' as user_type , '等於1單用戶' as details, thr_user_cnt as user_cnt from a_type_user_tmp
union all
select 'D類用戶' as user_type, '歷史有完單,最近90天無完單用戶' as details, 90_user_cnt as user_cnt from d_type_user_tmp
)t ;
4、分析結果的可視化
文檔領取
本文分享自微信公衆號 - DataScience(DataScienceTeam)。
如有侵權,請聯繫 [email protected] 刪除。
本文參與“OSC源創計劃”,歡迎正在閱讀的你也加入,一起分享。