Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions explore_database/reviews/reviews.sql
Original file line number Diff line number Diff line change
Expand Up @@ -386,17 +386,17 @@ WITH clean_review_channel AS
WHEN TRIM(LOWER(review_channel)) IN ('app', 'mobile app', 'mobile') THEN 'Mobile App'
WHEN TRIM(LOWER(review_channel)) IN ('in store', 'in-store', 'store') THEN 'In Store'
WHEN TRIM(LOWER(review_channel)) IN ('online', 'web') THEN 'Online'
WHEN TRIM(LOWER(review_channel)) = 'phone' THEN 'Phone Call'
WHEN TRIM(LOWER(review_channel)) = 'catalog' THEN 'Catalog'
WHEN TRIM(LOWER(review_channel)) = 'phone' THEN 'Phone Call'
WHEN TRIM(LOWER(review_channel)) = 'catalog' THEN 'Catalog'
ELSE 'Unknown'
END AS review_channel
FROM bronze.reviews
)
SELECT
review_channel,
COUNT(*) as channel_count,
CAST(ROUND(COUNT(*)*100/SUM(COUNT(*)) OVER(), 2)as nvarchar) + '%' as percentages
FROM clean_review_channel
review_channel,
COUNT(*) as channel_count,
CAST(ROUND(COUNT(*)*100/SUM(COUNT(*)) OVER(), 2)as nvarchar) + '%' as percentages
FROM clean_review_channel
GROUP BY review_channel
ORDER BY channel_count DESC ;

Expand All @@ -405,7 +405,7 @@ FROM clean_review_channel
--=============================================================================================
-- review_title data overview
SELECT
review_title
review_title
FROM bronze.reviews ;

-- review_title data profiling
Expand Down
Loading