网站热点词频统计(SQL 作业)

 

验证结果

更新时间 2023-09-06

统计每省前 3 热点词汇

  1. 通过 ClickHouse 连接工具登录 ClickHouse。
  2. 执行以下命令,查询每省前 3 热点词汇。
select *
from (select province, groupArray(3)(word) as keywords, groupArray(3)(total_count) as keywords_counts
      from (
            select word, province, sum(ct) as total_count
            from clickhouse_key_words
            where stt > '2022-01-21 00:00:00'
              and edt < '2022-01-21 23:59:59'
            group by word, province
            order by province, total_count desc)
      group by province
      order by province) ARRAY JOIN keywords, keywords_counts;

统计女性热点词汇前 10

  1. 通过 ClickHouse 连接工具登录 ClickHouse。

  2. 执行以下命令,查询女性热点词汇前 10。

    select word, sum(ct) as total_count
    from clickhouse_key_words
    where sex = '女'
    group by word
    order by total_count desc
    limit 10;
    
这篇文档解决了您的问题吗?
0
0