컬럼 구조 (Columns Definition)

5개 컬럼
컬럼명 데이터 타입 Null 허용 Key 기본값 (Default) 추가 속성 (Extra) 코멘트 / 설명
date
date YES - NULL - -
articles_count
bigint(21) NO - 0 - -
avg_importance
decimal(6,2) YES - NULL - -
keywords_active
bigint(21) NO - 0 - -
sources_count
bigint(21) NO - 0 - -

CREATE TABLE DDL

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_daily_stats` AS select cast(`articles`.`created_at` as date) AS `date`,count(0) AS `articles_count`,round(avg(`articles`.`importance_score`),2) AS `avg_importance`,count(distinct `articles`.`keyword_id`) AS `keywords_active`,count(distinct `articles`.`source`) AS `sources_count` from `articles` group by cast(`articles`.`created_at` as date) order by cast(`articles`.`created_at` as date) desc