-- 2 数据预分析
select
count(distinct user_id) as 用户数,
count(distinct item_id) as 商品数,
count(distinct item_category) as 类目数
from UserBehavior_new;
select behavior_type,count(*) as 行为次数
from UserBehavior_new
group by behavior_type;
在第一节基础上 更新了函数和执行顺序:实操了字符数函数、时间函数、字段截取函数、interval函数等,除最后顺序实操因未导入数据库,导致无法执行