电商项目之广告投放类统计表 SQL 实现|学习笔记

简介: 快速学习电商项目之广告投放类统计表 SQL 实现

开发者学堂课程【新电商大数据平台2020最新课程电商项目之广告投放类统计表 SQL 实现】学习笔记,与课程紧密联系,让用户快速学习知识。

课程地址:https://developer.aliyun.com/learning/course/640/detail/10570


电商项目之广告投放类统计表 SQL 实现

 

内容介绍:

一、广告投放类指标统计4X [ADS]

二、广告投放类统计表

 

一、广告投放类指标统计4X [ADS]

create external table if not exists ads_nshop.ads. nshop_release_stat(

device_ type string comment ‘设备类型',

os string comment '手机系统’,

customer _gender TINYINT comment ‘性别: 1男0女',

age_ range string comment’年龄段’,

customer _natives string comment ‘所在地区',

release_ sources string comment " 投放渠道'。

release_ category string comment ‘投放浏览产品分类’,

visit_ total_ customers int comment "总访客数’,

visit_ total_ counts int comment " 总访问次故"

) partitioned by (bdp_ day string)

stored as parquet

location ' /data/nshop/ ads/operation/ads_nshop. release. stat/'

 

二、广告投放类统计表

insert overwrite table ads_ nshop.ads_nshop_ release_ stat partition(bdp_day=‘20200321’)

select

dr.device _type,

dr.os,

oc.customer _gender ,

oc.customer _age_ range ,

oc.customer _natives,

dr.release _sources

dr.release _category,

count(distinct dr .customer_id) visit_total_ customers,

count(1) visit_total_ counts

from

dwd_ nshop.dwd_ nshop_releasedatas dr

join

ods_ nshop.ods_02_customer oc

on

dr.customer_id=oc .customer_id

where

dr .bdp_day= " 20200321 "

group by

dr.device_ type ,

dr.os ,

oc.customer_gender ,

oc.customer _age_ range ,

oc.customer _natives,

dr.release_ sources

dr.release _category

相关文章
|
3月前
|
SQL 数据库管理
第二章:基础查询与排序---SQL学习笔记
第二章:基础查询与排序---SQL学习笔记
57 0
|
1月前
|
Oracle Java 关系型数据库
【问题】Cause: java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK
【问题】Cause: java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK
|
3月前
|
SQL OLAP Serverless
第五章:SQL高级处理---SQL学习笔记
第五章:SQL高级处理---SQL学习笔记
40 0
|
3月前
|
SQL 关系型数据库 MySQL
第四章:集合运算---SQL学习笔记
第四章:集合运算---SQL学习笔记
59 0
|
3月前
|
SQL 关系型数据库 数据库
第三章:复杂一点的查询--SQL学习笔记
第三章:复杂一点的查询--SQL学习笔记
68 0
|
14天前
|
SQL 人工智能 算法
【SQL server】玩转SQL server数据库:第二章 关系数据库
【SQL server】玩转SQL server数据库:第二章 关系数据库
52 10
|
1月前
|
SQL 数据库 数据安全/隐私保护
Sql Server数据库Sa密码如何修改
Sql Server数据库Sa密码如何修改
|
23天前
|
SQL
启动mysq异常The server quit without updating PID file [FAILED]sql/data/***.pi根本解决方案
启动mysq异常The server quit without updating PID file [FAILED]sql/data/***.pi根本解决方案
17 0
|
14天前
|
SQL 算法 数据库
【SQL server】玩转SQL server数据库:第三章 关系数据库标准语言SQL(二)数据查询
【SQL server】玩转SQL server数据库:第三章 关系数据库标准语言SQL(二)数据查询
82 6
|
2天前
|
SQL 关系型数据库 MySQL
:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
8 0