Spaces:
Running
Running
| -- ํตํฉ ๋์๋ณด๋(BI)์ฉ ๋ถ์ ๊ฒฐ๊ณผ ์ ์ฅ ์คํค๋ง โ Supabase SQL Editor์ ๋ถ์ฌ ์คํ | |
| -- ๋ถ์ 1ํ = (keyword, run_date) ๋จ์. Tableau/Looker๊ฐ ๋ฐ๋ก ์กฐํํ ์ ์๋ ํ๋ซ ๊ตฌ์กฐ. | |
| -- 1) ๋ถ์ ์์ฝ (ํค์๋ยท๋ ์ง๋ณ 1ํ) | |
| create table if not exists analysis_run ( | |
| keyword text not null, | |
| run_date date not null, | |
| total_search_volume bigint, | |
| keyword_count integer, | |
| cluster_count integer, | |
| intent_info bigint default 0, -- ์ ๋ณด ํ์ํ ๊ฒ์๋ | |
| intent_transactional bigint default 0, -- ๊ตฌ๋งค/๊ฑฐ๋ํ | |
| intent_navigational bigint default 0, -- ๋ธ๋๋/๋ด๋น๊ฒ์ด์ ํ | |
| intent_mixed bigint default 0, -- ํผํฉํ | |
| marketing_suggestion text, | |
| primary key (keyword, run_date) | |
| ); | |
| -- 2) ํด๋ฌ์คํฐ๋ณ (๊ฒ์ ์๋ ๊ทธ๋ฃน) | |
| create table if not exists analysis_cluster ( | |
| id bigserial primary key, | |
| keyword text not null, | |
| run_date date not null, | |
| theme text, -- AI ํ ๋ง ๊ทธ๋ฃน๋ช | |
| rep_keyword text, -- ๋ํ ํค์๋ | |
| intent text, -- info | transactional | navigational | mixed | |
| total_search_volume bigint, | |
| keyword_count integer, | |
| top_keywords text -- ์ฃผ์ ํฌํจ ํค์๋ (์ผํ ๊ตฌ๋ถ) | |
| ); | |
| create index if not exists idx_cluster_kw_date on analysis_cluster (keyword, run_date); | |
| -- 3) ์ธ๊ตฌํต๊ณ ์ถ์ ๋น์ค (์ฑ๋ณร์ฐ๋ น) | |
| create table if not exists analysis_demographic ( | |
| id bigserial primary key, | |
| keyword text not null, | |
| run_date date not null, | |
| gender text, -- ๋จ์ฑ | ์ฌ์ฑ | |
| age text, -- 20๋ ์ดํ | 30๋ | 40๋ | 50๋ ์ด์ | |
| pct numeric -- ์ถ์ ๋น์ค(%) | |
| ); | |
| create index if not exists idx_demo_kw_date on analysis_demographic (keyword, run_date); | |