1-- Xem cấu trúc bảng fact_sales
2SELECT column_name, data_type
3FROM information_schema.columns
4WHERE table_name = 'fact_sales'
5ORDER BY ordinal_position;
6
7-- Đếm records từng bảng
8SELECT 'dim_customer' AS table_name, COUNT(*) AS row_count FROM dim_customer
9UNION ALL
10SELECT 'dim_product', COUNT(*) FROM dim_product
11UNION ALL
12SELECT 'dim_store', COUNT(*) FROM dim_store
13UNION ALL
14SELECT 'fact_sales', COUNT(*) FROM fact_sales
15UNION ALL
16SELECT 'fact_inventory', COUNT(*) FROM fact_inventory
17UNION ALL
18SELECT 'fact_returns', COUNT(*) FROM fact_returns;