-- Step 8: Verification queries
-- Run this BEFORE dropping old tables

-- Count verification
SELECT 'match_team_stats' as tbl, COUNT(*) FROM match_team_stats
UNION ALL
SELECT 'football_team_stats', COUNT(*) FROM football_team_stats
UNION ALL
SELECT 'basketball_team_stats', COUNT(*) FROM basketball_team_stats
UNION ALL
SELECT 'match_ai_features', COUNT(*) FROM match_ai_features
UNION ALL
SELECT 'football_ai_features', COUNT(*) FROM football_ai_features
UNION ALL
SELECT 'basketball_ai_features', COUNT(*) FROM basketball_ai_features
UNION ALL
SELECT 'basketball_player_stats', COUNT(*) FROM basketball_player_stats
UNION ALL
SELECT 'odd_categories (with sport)', COUNT(*) FROM odd_categories WHERE sport IS NOT NULL
UNION ALL
SELECT 'odd_selections (with sport)', COUNT(*) FROM odd_selections WHERE sport IS NOT NULL;

-- Sport distribution
SELECT 'football_team_stats by sport' as info, m.sport, COUNT(*) 
FROM football_team_stats fts JOIN matches m ON m.id = fts.match_id GROUP BY m.sport
UNION ALL
SELECT 'basketball_team_stats by sport', m.sport, COUNT(*) 
FROM basketball_team_stats bts JOIN matches m ON m.id = bts.match_id GROUP BY m.sport;
