1.美图
上一篇:http://blog.csdn.net/qq_21383435/article/details/75198823
1。根据上一张分析的内容得知。
涉及到的字段是
pro表的
字段: ID 商品名称 价格 购买数量 付款 类别ID 时间
聚合函数:sum(num) ,sum(pay)
cate表的
字段:ID 类别名称
聚合函数:无
2。首先我们要设计建表语句
create table prob(
id bigint,
name string,
price int,
num int,
pay int,
cid bigint,
date_time string)
row format delimited fields terminated by '\t' stored as textfile;
create table cateb(
caid bigint,
caname string)
row format delimited fields terminated by '\t' stored as textfile;
注意:这里建标语句和第一章有一点不同,cate表的caid ,caname字段名不一样了,因为如果一样两个名称会相同