bi-fundamentals
Business Intelligence Fundamentals
Metric Definition & Calculation
Business Metrics
-- Core business metrics
-- Revenue metrics
SELECT
DATE_TRUNC('month', order_date)::DATE as month,
ROUND(SUM(amount), 2) as total_revenue,
COUNT(DISTINCT order_id) as order_count,
ROUND(SUM(amount) / COUNT(DISTINCT order_id), 2) as avg_order_value,
COUNT(DISTINCT customer_id) as unique_customers,
ROUND(SUM(amount) / COUNT(DISTINCT customer_id), 2) as revenue_per_customer
FROM orders
GROUP BY DATE_TRUNC('month', order_date)
More from pluginagentmarketplace/custom-plugin-sql
mysql
MySQL database administration and development
452data-analysis-sql
SQL for data analysis with exploratory analysis, advanced aggregations, statistical functions, outlier detection, and business insights. 50+ real-world analytics queries.
57data-warehouse
Data warehouse design mastery with star schema, dimensional modeling, fact/dimension tables, slowly changing dimensions, and enterprise best practices. Complete schema examples included.
51redis
Redis data structures and commands including strings, lists, hashes, sets, sorted sets, streams, and transactions for high-performance caching and real-time applications.
49postgresql
PostgreSQL administration and setup including installation, configuration, backup/recovery, replication, and high-availability. Learn production PostgreSQL operations.
41sql-fundamentals
Master SQL fundamentals including SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP operations. Learn data types, WHERE clauses, ORDER BY, GROUP BY, and basic joins.
29