Skip to content
Aabha AI Academy
Skip to reading

SQL

01 Profile

-- 01_profile: Count each table
-- Read-only reference query. Setup must be loaded first.
SELECT 'customers' AS table_name, COUNT(*) AS row_count FROM aabha_sql.customers
UNION ALL SELECT 'orders', COUNT(*) FROM aabha_sql.orders
UNION ALL SELECT 'order_items', COUNT(*) FROM aabha_sql.order_items
UNION ALL SELECT 'payments', COUNT(*) FROM aabha_sql.payments
UNION ALL SELECT 'refunds', COUNT(*) FROM aabha_sql.refunds
ORDER BY table_name;

Download this source file