컬럼 구조 (Columns Definition)
4개 컬럼| 컬럼명 | 데이터 타입 | Null 허용 | Key | 기본값 (Default) | 추가 속성 (Extra) | 코멘트 / 설명 |
|---|---|---|---|---|---|---|
|
source
|
varchar(100) | YES | - | NULL | - | - |
|
total_articles
|
bigint(21) | NO | - | 0 | - | - |
|
avg_importance
|
decimal(6,2) | YES | - | NULL | - | - |
|
latest_article
|
timestamp | YES | - | current_timestamp() | - | - |
CREATE TABLE DDL
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_source_stats` AS select `articles`.`source` AS `source`,count(0) AS `total_articles`,round(avg(`articles`.`importance_score`),2) AS `avg_importance`,max(`articles`.`created_at`) AS `latest_article` from `articles` where `articles`.`source` is not null group by `articles`.`source` order by count(0) desc