Supplemental Study Guide – Original Student Support Material
This document is an original supplementary study guide created for student support. It is not an official syllabus, verified TU outline, or approved course structure. The 2025 TU curriculum source confirms course identity only (BCA405-II, semester 7) and does not provide a detailed unit outline. All content herein is independently generated for learning support purposes.
Decision Support vs. Business Intelligence
Decision support systems (DSS) and business intelligence (BI) are closely related but distinct concepts. Decision support is a broad category of computer-based systems that help decision-makers compile information from raw data, documents, personal knowledge, and business models. DSS focuses on solving unstructured problems and typically supports semi-structured or unstructured decision-making contexts. Business Intelligence, by contrast, is a more specific category that emphasizes data-driven approaches, leveraging technologies, tools, and practices to collect, integrate, analyze, and present business information.
Key distinctions:
- Scope: DSS encompasses a wider range of support methods including modeling, what-if analysis, and expert systems. BI is specifically focused on data analysis from historical and current business operations.
- Data focus: BI relies heavily on data warehousing, integration, and quantitative analysis. DSS may use diverse data sources including manual inputs and expert judgment.
- Typical use: DSS might support a one-time strategic decision (e.g., site selection for a new facility). BI typically enables ongoing, repetitive analysis of business performance (e.g., monthly sales dashboards).
- Technology: BI platforms include specific tools for ETL, data modeling, querying, and visualization. DSS may incorporate these but also includes simulation, optimization, and other decision-making algorithms.
Both approaches share the goal of improving decision quality, but BI provides a more structured, data-intensive framework that has become the dominant approach in modern enterprises. Understanding both is valuable: BI provides the data foundation, while DSS methodologies extend analysis into strategic problem-solving.
Data Sources and ETL
Business Intelligence begins with identifying and connecting to appropriate data sources. Enterprise data resides in numerous systems—ERP (enterctor resource planning), CRM (customer relationship management), SCM (supply chain management), relational databases, flat files, APIs, and cloud services. Each source carries unique structure, quality, and access considerations.
Extract is the first ETL step, where data is pulled from source systems. This may involve database queries, API calls, file imports, or messaging system reads. Quality at extraction matters: missing fields, inconsistent formats, and duplicate records compound downstream.
Transform is the critical middle step. Data cleaning handles nulls, out-of-range values, and structural inconsistencies. Type conversion ensures numeric fields are numeric, date fields follow a consistent format. Derived fields may be created (e.g., computing age from birth date, concatenating name parts). Business rules apply calculations, classifications, and aggregations. For example, raw transaction data may be aggregated to daily or monthly granularity. Integration across sources requires key reconciliation (surrogate keys, natural key matching) and handling of referential integrity.
Load moves transformed data into the target repository, typically a data warehouse or data mart. Load methods include full load (replacing all data, typically initial setup) and incremental load (applying changes since last load, using techniques like change data capture or timestamps). Load tracking ensures data freshness and recoverability. Modern pipelines often use ELT (extract, load, transform) where raw data lands in the warehouse first, and transformation occurs using warehouse-native processing—this leverages warehouse scalability but requires careful governance.
ETL/ELT pipelines require monitoring for freshness, data volume growth, schema changes, and failure alerts. Logging, unit tests for each transformation, and documentation of source-to-target mappings are essential practices. Many organizations use specialized ETL tools (Informatica, Talend, Azure Data Factory) or orchestrate scripts (Python, dbt) within workflow engines (Airflow, Prefect).
Data Warehouses and Data Marts
A data warehouse is a centralized repository of integrated data from one or more disparate sources. It stores current and historical data used for creating analytical reports for knowledge workers across the enterprise. The key design principle distinguishes warehouses from operational databases: optimization for read-heavy query workloads, not transaction processing (OLTP). Warehouses use columnar storage, aggregated data, and denormalized schemas to deliver sub-second query performance on billions of rows.
Enterprise data warehouse (EDW) integrates data across the entire organization, often spanning multiple business units, divisions, and geographies. It serves as the single source of truth for enterprise-wide analytics. EDWs typically use robust platforms (Snowflake, Amazon Redshift, Azure Synapse, Google BigQuery) with scalability, concurrency, and security features.
Data marts are smaller, focused subsets of a data warehouse, oriented to a specific business line, department, or subject area (e.g., sales mart, finance mart, marketing mart). Data marts may be dependent (subset of an EDW, filtered and joined for a specific team) or independent (standalone warehouse built from specific source(s) for a department). Marts deliver faster deployment, simpler queries, and department-level ownership, but risk data silos and inconsistency if not governed.
Key warehouse characteristics:
- Subject-oriented: data organized by business subject (customer, product, sales, not by application)
- Integrated: consistent keys, data codes, and naming conventions across sources
- Time-variant: historical storage, typically spanning 3–7+ years, enabling trend analysis
- Non-volatile: once written, data is not changed by operational operations; historical integrity is maintained
The warehouse-to-mart spectrum reflects organizational maturity: mature enterprises build an EDW and derive marts through views or schema partitioning; smaller organizations may start with a mart and expand toward an EDW over time.
Star Schema and Snowflake Schema
Dimensional modeling organizes data into fact tables (measurable events) and dimension tables (contextual attributes). Two primary schema structures dominate BI implementations: star schema and snowflake schema.
Star schema features a single fact table directly linked to multiple dimension tables. Each dimension table connects to the fact table via a foreign key; dimension tables are not further normalized. The resulting diagram resembles a star—one central circle (fact) with radiating circles (dimensions). Advantages include simplicity, fewer joins, easier query writing, and better performance for typical BI queries. Star schemas are ideal when dimension tables are relatively narrow, when query performance is critical, and when the business user community values simplicity. Common fact table metrics include sales amount, quantity sold, units shipped, account balance, visit count. Dimension tables include time (date, month, quarter, year), geography (country, region, city), product (name, category, brand, size), and customer (name, segment, location, signup date).
Snowflake schema normalizes one or more dimension tables, breaking them into related sub-tables. A dimension like "product" might split into product (basic info), category (category hierarchy), and subcategory (finer granularity). The entity-relationship diagram looks like a snowflake—multiple interconnected circles. Advantages include reduced data redundancy, smaller storage footprint, and easier maintenance when dimension hierarchies change frequently. Disadvantages are more joins per query, increased complexity, and potential query performance degradation due to additional lookup tables. Snowflake schemas work well when dimension attributes have high redundancy that wastes storage, when multiple fact tables share normalized dimensions, or when the organizational structure supports separate database teams managing dimension tables.
Choosing between star and snowflake:
- Start with star schema for most BI implementations—simplicity delivers faster time-to-value.
- Normalize to snowflake when storage costs are significant, dimension hierarchies are deep and stable, or maintenance complexity of denormalized dimensions outweighs query performance benefits.
- Many modern platforms (columnar warehouses with effective compression) reduce the storage advantage of snowflake, making star schema comparatively more attractive.
- Hybrid approaches exist: keep the fact table in star format, normalize select large or slowly-changing dimensions.
The course emphasizes that schema choice is a business trade-off, not merely a technical decision. Consider user skill set, query patterns, data volume, update frequency, and total cost of ownership.
OLAP (Online Analytical Processing)
OLAP technology enables multi-dimensional analysis of business data, supporting complex ad-hoc queries, trend analysis, and rapid data exploration. OLAP systems sit between raw data sources and BI presentation tools, providing a specialized query engine and data organization optimized for analysis rather than transaction processing.
Multidimensional OLAP (MOLAP) stores data in multidimensional arrays (cubes). Data is pre-aggregated into subsets corresponding to common query patterns (e.g., sales by year, by region, by product). Advantages include fastest query performance for supported queries, efficient storage of dense data, and native support for MDX (Multidimensional Expressions) query language. Limitations are storage overhead from pre-aggregations, less flexibility for arbitrary new dimensions, and cube rebuild requirements when source data changes.
Relational OLAP (ROLAP) stores data in relational databases and uses SQL-based operations to emulate OLAP functionality. ROLAP does not pre-aggregate; instead, it leverages warehouse indexing, partitioning, and query optimization. Advantages include virtually unlimited data volume (limited by database capacity), flexibility for any query shape, and no cube rebuild needed. Limitations are potentially slower query performance for complex multi-dimensional operations, and reliance on underlying SQL optimization.
Hybrid OLAP (HOLAP) combines MOLAP and ROLAP: fact data stored in relational tables, aggregated data in multidimensional format. Frequently accessed measures use the multidimensional store; detailed drills go to the relational store. This balances performance and flexibility but adds system complexity.
Common OLAP operations:
- Roll-up: Aggregate data along a dimension hierarchy (e.g., from month to quarter to year).
- Drill-down: Navigate from higher to lower detail (e.g., from total sales to individual transactions).
- Slice: Select one dimension to view a two-dimensional subset (e.g., view sales for one product category only).
- Dice: Select a subset across multiple dimensions (e.g., sales for a specific region, time period, and product category).
- Pivot (rotate): Reorient axes in view (e.g., switch rows from product to region, columns from month to quarter).
OLAP engines may be embedded within BI platforms (Power BI, Tableau) or exist as separate servers (SAS OLAP, Oracle OLAP, IBM Cognos). The course notes that most modern cloud warehouses provide OLAP-like capabilities through SQL extensions (window functions, CUBE, ROLLUP, GROUPING SETS), reducing the need for separate OLAP infrastructure for many organizations.
Key Performance Indicators (KPIs)
KPIs are measurable values that demonstrate how effectively an organization is achieving key business objectives. Unlike general metrics (any quantitative measurement), KPIs are strategically selected indicators with clear targets, comparison benchmarks, and regular reporting cadence. Effective KPI design is central to BI value delivery.
KPI quality criteria (SMART framework and beyond):
- Specific: Clearly defined, not vague. "Revenue" is a metric; "Monthly recurring revenue from new enterprise customers in North America" is a KPI.
- Measurable: Data exists, can be collected, and calculation is unambiguous.
- Achievable: Target is realistic given resources, market conditions, and historical performance.
- Relevant: Directly ties to a strategic objective that matters to the business.
- Time-bound: Has a clear reporting period (daily, weekly, monthly, quarterly, yearly).
KPI types:
- Leading indicators: Predict future outcomes (e.g., pipeline value, trial sign-ups, employee engagement score). Lead measures enable proactive adjustment.
- Lagging indicators: Confirm past results (e.g., quarterly revenue, churn rate, safety incident count). Lag measures validate whether leading indicators were effective.
- Input measures: Resources consumed (e.g., marketing spend, support headcount). These influence output measures.
- Process measures: Efficiency or quality of a process (e.g., order fulfillment cycle time, error rate). These indicate how well operations run.
- Output measures: Final results (e.g., revenue, units sold, customer satisfaction score). These answer "did we achieve the goal?"
KPI design pitfalls:
- Too many KPIs (dilution; focus on 3–7 critical per team/organization).
- Vague definitions (different stakeholders calculate differently; document formulas).
- Missing targets (a number without context is just a number).
- vanity metrics (impressive numbers that don't correlate with business value).
- Changing definitions (inconsistency over time erodes trust; lock KPI formulas).
- Ignoring data quality (KPIs based on flawed data produce misleading signals).
KPI governance: Establish a KPI registry with owner, definition, formula, data source, refresh frequency, and target. Review quarterly to retire outdated KPIs and add new ones reflecting shifting strategy. KPI committees (cross-functional) ensure alignment across departments.
Descriptive, Diagnostic, Predictive, and Prescriptive Analytics
BI spans four analytic levels, each building on the previous. Understanding this hierarchy helps frame appropriate questions and methods for different business needs.
Descriptive analytics answers "what happened?" It summarizes historical data to identify trends, patterns, and anomalies. Typical techniques include summary statistics, frequency tables, charts (line, bar, pie), dashboards, and reporting. Descriptive analytics forms the foundation: you cannot analyze what you cannot describe. Most BI implementations start here, delivering monthly/quarterly reports, scorecards, and status dashboards. Example: "Q3 revenue was $4.2M, up 8% from Q2."
Diagnostic analytics answers "why did it happen?" It drills into descriptive results to identify root causes, correlations, and patterns. Techniques include drill-down, data mining, correlation analysis, regression, and hypothesis testing. Diagnostic analytics moves beyond "what" to "why." Example: "Revenue increased 8% in Q3, driven by a 15% growth in the technology segment, while the retail segment declined 3% due to reduced big-box store orders."
Predictive analytics answers "what might happen?" It uses statistical models and machine learning techniques on historical data to forecast future values or classify outcomes. Techniques include time series forecasting, regression models, classification (logistic, decision trees), clustering, and scenario analysis. Predictive analytics enables proactive decision-making. Example: "Based on current pipeline and seasonality, we project Q4 revenue of $4.5M (±5% confidence interval)."
Prescriptive analytics answers "what should we do?" It recommends actions to achieve desired outcomes, often optimizing against constraints. Techniques include optimization (linear, integer, nonlinear), simulation, decision analysis, and what-if modeling. Prescriptive analytics closes the loop: not only forecasting what will happen, but suggesting how to influence it. Example: "To reach $5M Q4 revenue, increase technology-segment marketing spend by 12% and deploy two additional sales reps to the enterprise pipeline."
Analytics progression in practice:
Most organizations mature from descriptive toward predictive and prescriptive over time. The maturity journey requires data foundations (warehouse, quality), analytical skills (statistics, programming), and cultural shift (data-driven decision-making). Not all business questions require advanced analytics; descriptive and diagnostic often suffice for operational monitoring and periodic review. However, competitive pressures increasingly drive adoption of predictive and prescriptive methods for pricing, inventory, staffing, and customer retention decisions.
The course emphasizes that technology alone does not deliver advanced analytics. Quality data, statistical understanding, and business context are equally important. A simple descriptive dashboard with clear, well-defined KPIs often provides more value than a complex predictive model based on poor data.
Dashboards and Data Visualization
Dashboards provide at-a-glance visual summaries of key metrics and trends, enabling rapid monitoring and exploration. Effective dashboard design integrates data visualization principles, user-centered design, and technical considerations.
Design principles:
- Know your audience: Executives need high-level summaries; analysts need detailed interactive exploration; operational users need real-time alerts.
- Limit visuals: 5–9 core metrics per dashboard (cognitive limit; Miller's law). Prioritize what matters most.
- Tell a story: Arrange visuals in logical flow (top-to-bottom, left-to-right). Use headlines and annotations to guide interpretation.
- Reduce chartjunk: Eliminate gridlines, background colors, 3D effects, and decorative elements that do not convey information (Tufte's classic critique).
- Consistent encoding: Use same colors, symbols, and scales for same-category data across dashboard.
- Aligned axes: Start bar/line charts at zero unless truncation is explicitly noted and justified.
- Contextualize: Include comparison benchmarks (prior period, target, industry average) within or adjacent to visuals.
Chart selection guidelines:
| Goal | Recommended Chart | Avoid |
|---|---|---|
| Compare categories | Bar chart (vertical/horizontal) | Pie chart, donut chart with >3 slices |
| Show trend over time | Line chart, area chart | Bar chart (unless few categories) |
| Part-of-whole | Pie chart (≤5 categories), stacked bar | Pie with many categories, 3D pie |
| Relationship/correlation | Scatter plot, bubble chart | Bar/line charts (not designed for correlation) |
| Geographical distribution | Choropleth map, symbol map | Raw coordinate plots without context |
| Ranking | Pareto chart (bar + cumulative line) | Standard bar without ordering |
Interactivity features:
- Filtering: Slice data by dimension (region, time period, product line).
- Drill-down: Navigate from summary to detail (e.g., from total sales to individual order).
- Highlighting: Emphasize selected data points; dim the rest.
- Parameters: User-supplied values that change calculations or visual ranges (e.g., "show data for last N days").
- Bookmarking/saving: Preserve current view state for return or sharing.
Tools: Power BI, Tableau, Qlik Sense, Looker, Django, React + D3.js, Excel charts. Each has strengths: Power BI integrates well with Microsoft ecosystems and offers affordable pro licensing; Tableau leads in visualization flexibility and community resources; Qlik's associative engine enables unexpected exploratory discoveries; Looker provides code-first modeling and embedded analytics.
Technical considerations:
- Performance: large dashboards (50+ visuals) may load slowly; use aggregations, sampling, and efficient data models.
- Responsiveness: dashboards should render on desktop, tablet, and phone; use responsive layouts and mobile-specific views.
- Accessibility: color-blind palettes, alt-text for charts, keyboard navigation, screen-reader compatibility.
- Data freshness: configure refresh schedules (real-time, hourly, daily) matching business needs; surface last-updated timestamp.
- Security: row-level security, field-level permissions, and authentication integrate with organizational identity systems.
Worked case: Design a sales performance dashboard for a regional manager. Include: total sales YTD (KPI), sales by region (bar chart), sales trend by month (line chart), top 5 products by sales (bar chart), sales vs. target progress (progress bar, gauge). Use interactive filtering by month/quarter and drill-down to store level. The dashboard loads in under 3 seconds with 2M-row fact table, using pre-aggregated tables and indexed dimension columns.
Governance, Privacy, and Data Quality
BI success depends not only on technology and analysis but on robust governance ensuring data reliability, legal compliance, and ethical use. Governance frameworks define policies, roles, and processes for managing data assets across the lifecycle.
Data governance encompasses the people, processes, and technologies that ensure data quality, consistency, and security across the organization. Key pillars:
- Data stewardship: Assign owners (data stewards) responsible for specific domains (customer, product, finance). Stewards validate data quality, resolve definitions, and enforce policies. Stewardship is not IT-only; business unit representation ensures relevance and adoption.
- Data quality management: Implement metrics (completeness, accuracy, consistency, timeliness, uniqueness) and monitor continuously. Automated data profiling identifies issues (null rates, out-of-range values, referential brokenness). Data quality rules trigger remediation workflows or suppress low-quality data in reports.
- Metadata management: Document data definitions, source systems, transformation logic, and lineage (end-to-end traceability from source report value to source system field). Metadata repositories (collibra, informatica mgmt, open-source) support impact analysis when sources change.
- Data security: Protect confidentiality, integrity, and availability. Classify data by sensitivity (public, internal, confidential, restricted). Apply encryption at rest and in transit. Implement authentication (who can access) and authorization (what they can see/do). Row-level security restricts users to their organizational segment; column-level masking hides sensitive fields (SSN, salary) from unauthorized roles.
- Audit and compliance: Maintain logs of data access, modifications, and exports. Generate compliance reports for regulatory audits. Documentation supports data provenance questions ("where did this number come from?").
Data quality in practice: A telecommunications company implementing a customer analytics dashboard discovered 12% of phone numbers were malformed, causing inaccurate geolocation and contact analysis. The governance framework established a data quality rule: "Phone numbers must match E.164 format; flag and remediate." Monthly profiling now monitors this rule, and the dashboard includes a data quality warning banner when null/exceed rates exceed 5%. The case illustrates how governance directly improves BI reliability.
Ethical considerations: Beyond legal compliance, ethical data use respects user trust, avoids bias, and considers broader social impact. BI models may inadvertently encode historical bias (e.g., lending decisions based on zip code correlating with race). Transparency about data sources, assumptions, and limitations is essential. Diverse project teams help identify blind spots. Opt-out and data deletion mechanisms respect user autonomy.
Worked SQL/BI Case: Building a Sales Performance Dashboard
This section walks through a complete SQL/BI case from raw data to dashboard-ready dataset. The case uses a retail sales scenario common in BI coursework and practice.
Schema: Four tables model a retail business.
dim_date(date_id PK, date, day_name, month, quarter, year, semester)dim_product(product_id PK, product_name, category, subcategory, brand, cost, price)dim_store(store_id PK, store_name, city, region, manager, open_date)fact_sales(sale_id PK, date_id FK, product_id FK, store_id FK, quantity, unit_price, discount_pct, total_amount, units_sold)
Sample data reality: The fact table contains 2+ million rows across 3 years, 50 products, 10 stores, 365+ dates.
Business question: "What are the top 5 product categories by total sales revenue, and how does each perform regionally?"
Step 1: Explore and understand data
-- Preview fact table structure and volumes
SELECT COUNT(*) AS total_rows,
COUNT(DISTINCT date_id) AS active_dates,
COUNT(DISTINCT product_id) AS active_products,
COUNT(DISTINCT store_id) AS active_stores
FROM fact_sales;
-- Check for nulls and outliers
SELECT
COUNT(*) AS null_total_amount,
COUNT(*) FILTER (WHERE total_amount < 0) AS negative_amounts,
COUNT(*) FILTER (WHERE quantity <= 0) AS invalid_quantity
FROM fact_sales;
Step 2: Aggregate to required granularity
-- Top 5 categories by total revenue, with regional breakdown
WITH category_revenue AS (
SELECT
p.category,
s.region,
SUM(f.total_amount) AS revenue,
SUM(f.units_sold) AS units,
COUNT(DISTINCT f.sale_id) AS transactions
FROM fact_sales f
JOIN dim_product p ON f.product_id = p.product_id
JOIN dim_store s ON f.store_id = s.store_id
JOIN dim_date d ON f.date_id = d.date_id
WHERE d.year = 2024
GROUP BY p.category, s.region
),
category_totals AS (
SELECT
category,
SUM(revenue) AS total_revenue,
SUM(units) AS total_units,
SUM(transactions) AS total_txns
FROM category_revenue
GROUP BY category
),
ranked AS (
SELECT
c.category,
c.region,
c.revenue,
c.units,
c.transactions,
SUM(c.revenue) OVER (PARTITION BY c.category ORDER BY c.revenue DESC) AS running_total,
ROW_NUMBER() OVER (PARTITION BY c.category ORDER BY c.revenue DESC) AS rn
FROM category_revenue c
JOIN category_totals t ON c.category = t.category
ORDER BY c.category, c.revenue DESC
)
SELECT category, region, revenue, units, transactions
FROM ranked
WHERE rn <= 5 -- top 5 regions per category
ORDER BY category, revenue DESC;
Step 3: Add comparative metrics
-- Compare to prior year same period
WITH current_year AS (
SELECT /* same aggregation as above */ WHERE d.year = 2024
),
prior_year AS (
SELECT /* same aggregation */ WHERE d.year = 2023
),
comparison AS (
SELECT
c.category,
c.region,
c.revenue AS current_revenue,
p.revenue AS prior_revenue,
ROUND((c.revenue - p.revenue) / NULLIF(p.revenue, 0) * 100, 2) AS pct_change,
CASE WHEN p.revenue = 0 THEN 'N/A'
WHEN c.revenue > p.revenue THEN 'Growth'
WHEN c.revenue = p.revenue THEN 'Flat'
ELSE 'Decline' END AS trend
FROM current_year c
LEFT JOIN prior_year p USING (category, region)
)
SELECT * FROM comparison
WHERE current_revenue IS NOT NULL
ORDER BY current_revenue DESC;
Step 4: Export to BI tool
The query result set becomes a dataset in Power BI/Tableau. Measures defined:
Total Revenue= SUM(total_amount)Total Units= SUM(units_sold)Transaction Count= COUNT(sale_id)YoY % Change= (Current - Prior) / Prior * 100Revenue % of Grand Total= Revenue / SUM(Revenue) OVER() * 100
Visualizations built:
- Matrix visual: Rows = category, region; Columns = Revenue, Units, Transactions; Conditional formatting colors highest/lowest.
- Bar chart: Top 5 categories by revenue (descending).
- Line chart: Monthly revenue trend within top category.
- Ge map: Revenue by store location (bubble size = revenue).
- KPI card: Total 2024 revenue, vs. prior year, target %.
Step 5: Documentation and sharing
- Save query as view
v_sales_category_regionin warehouse. - Document grain: one row per (category, region, date, product, store)—confirm no unexpected duplication.
- Define business terms in data dictionary: "Revenue" = SUM of total_amount including discount; "Units" = SUM of units_sold.
- Schedule refresh: daily at 02:00 AM, ensuring prior day's transactions are captured.
- Security: regional managers see only their region's data; VP sees all.
Lessons learned:
- Always validate data grain before building dashboards—duplicate rows distort metrics.
- Use window functions (RUNNING_TOTAL, RANK) for comparisons within result sets rather than separate queries.
- Document date filters explicitly (YTD vs. FY vs. Calendar year) to avoid ambiguity.
- Include data quality checks (null rates, row counts) as first step; unexpected volumes signal pipeline issues.
- Test exported dataset in BI tool before committing to dashboard design; column types, aggregation behaviors, and null handling may differ from SQL expectations.
Lab Exercises and Answer Key
Exercise 1: Star Schema Design
Scenario: Design a star schema for a university analyzing course enrollments, student performance, and resource utilization.
Tasks:
a. Identify the fact table and its primary key. What metrics would it store?
b. List at least four dimension tables, with key attributes for each.
c. Sketch the star schema diagram (fact table at center, dimensions radiating outward).
d. Write a SQL query to compute total credits enrolled by student major and enrollment year.
Answer Key:
a. Fact table: enrollment (enrollment_id PK, student_id FK, course_id FK, term_id FK, grade, credits). Metrics: credits (numeric), grade (categorical), status (active, withdrawn, completed). Grain: one row per student-course-term enrollment.
b. Dimension tables:
dim_student(student_id PK, major, enrollment_date, status, age_group, gender)dim_course(course_id PK, course_name, department, level, credit_hours, format)dim_term(term_id PK, year, semester, start_date, end_date, add/drop deadline)dim_department(dept_id PK, dept_name, college, director)
c. Schema diagram (Mermaid):
erDiagram
FACT_ENROLLMENT ||--|{ DIM_STUDENT : enrolls
FACT_ENROLLMENT ||--|{ DIM_COURSE : for
FACT_ENROLLMENT ||--|{ DIM_TERM : during
FACT_ENROLLMENT ||--|{ DIM_DEPARTMENT : offered_by
d. SQL query:
SELECT
d.year,
s.major,
SUM(e.credits) AS total_credits,
COUNT(DISTINCT e.student_id) AS students_enrolled
FROM fact_enrollment e
JOIN dim_student s ON e.student_id = s.student_id
JOIN dim_term d ON e.term_id = d.term_id
GROUP BY d.year, s.major
ORDER BY d.year, total_credits DESC;
Exercise 2: SQL Window Functions
Scenario: Given sales data, compute running total and rank products within category.
Tasks:
a. Write a query that returns each sale with running total of sales amount, ordered by date, partitioned by product.
b. Add a column ranking products by total sales within each category, using DENSE_RANK.
c. Identify the sale with the highest revenue in each product category.
Answer Key:
a. Running total:
SELECT
s.sale_id,
s.product_id,
s.sale_date,
s.total_amount,
SUM(s.total_amount) OVER (PARTITION BY s.product_id ORDER BY s.sale_date ROWS UNBOUNDED PRECEDING) AS running_total
FROM sales s
ORDER BY s.product_id, s.sale_date;
b. Dense rank by category:
WITH product_sales AS (
SELECT
p.category_name,
s.product_id,
SUM(s.total_amount) AS category_sales
FROM sales s
JOIN product p ON s.product_id = p.product_id
GROUP BY p.category_name, s.product_id
),
ranked AS (
SELECT
category_name,
product_id,
category_sales,
DENSE_RANK() OVER (PARTITION BY category_name ORDER BY category_sales DESC) AS drnk
FROM product_sales
)
SELECT * FROM ranked WHERE drnk <= 3;
c. Top sale per category:
WITH ranked_sales AS (
SELECT
p.category_name,
s.sale_id,
s.total_amount,
ROW_NUMBER() OVER (PARTITION BY p.category_name ORDER BY s.total_amount DESC) AS rn
FROM sales s
JOIN product p ON s.product_id = p.product_id
)
SELECT category_name, sale_id, total_amount
FROM ranked_sales
WHERE rn = 1;
Exercise 3: ETL Logic and Data Quality
Scenario: Customer table needs consolidation from three source systems (CRM, support ticketing, marketing platform).
Tasks:
a. Write a SQL merge/upsert statement that inserts new customers and updates existing ones (based on email) from a source staging table.
b. Identify three data quality rules to validate the consolidated table.
c. Write a profiling query to check each rule.
Answer Key:
a. Merge statement (PostgreSQL syntax):
MERGE INTO dim_customer target
USING stg_customer source
ON target.email = source.email
WHEN MATCHED THEN
UPDATE SET
target.first_name = source.first_name,
target.last_name = source.last_name,
target.phone = source.phone,
target.update_dt = CURRENT_TIMESTAMP
WHEN NOT MATCHED THEN
INSERT (email, first_name, last_name, phone, create_dt, update_dt)
VALUES (source.email, source.first_name, source.last_name, source.phone, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
b. Data quality rules:
- Email format: all customer emails must match pattern
^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$. - No duplicate primary keys: each customer_id appears at most once.
- Phone format: if provided, must be numeric 10–15 digits (country code included).
c. Profiling queries:
-- Rule 1: Invalid email format
SELECT COUNT(*) AS invalid_emails
FROM dim_customer
WHERE email !~ '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$';
-- Rule 2: Duplicate keys
SELECT COUNT(*) AS total_rows, COUNT(DISTINCT customer_id) AS unique_keys
FROM dim_customer
HAVING total_rows != unique_keys;
-- Rule 3: Phone format violations
SELECT COUNT(*) AS invalid_phones
FROM dim_customer
WHERE phone IS NOT NULL AND (phone !~ '^[0-9]{10,15}$' OR LENGTH(phone) = 0);
Exercise 4: KPI Design
Scenario: Design KPIs for a nonprofit tracking donor retention and campaign effectiveness.
Tasks:
a. Propose 3 KPIs: one leading, one lagging, one process.
b. For each KPI, define: formula, data source, target, reporting frequency.
c. Identify one vanity metric to avoid and explain why.
Answer Key:
a. Proposed KPIs:
- Leading: Monthly new donor acquisition count. Predicts future revenue trend.
- Lagging: Annual donor retention rate. Confirms whether donor relationships are sustained.
- Process: Average donation processing time (from receipt to bank deposit). Indicates operational efficiency.
b. KPI definitions:
| KPI | Formula | Data Source | Target | Frequency |
|---|---|---|---|---|
| New donor acquisition count | COUNT(DISTINCT new_donor_id) WHERE first_donation_date = current_month | donations table | 50 new donors/month | Monthly |
| Donor retention rate | COUNT(DISTINCT donors_with_repeat_donation) / COUNT(DISTINCT active_donors_last_year) | donations table | ≥ 60% | Annually |
| Donation processing time | AVG(TIMESTAMP_DEPOSIT - TIMESTAMP_RECEIPT) hours | donations, banking table | ≤ 3 days | Weekly |
Swipe to see all columns
c. Vanity metric to avoid: "Total registered donors" without distinguishing active vs. lapsed. A growing registry may mask declining engagement; retention rate provides more meaningful insight.
Exercise 5: Schema Comparison
Tasks:
a. List two advantages and two disadvantages of star schema vs. snowflake schema.
b. When would you choose snowflake over star? Provide a realistic scenario.
Answer Key:
a. Star schema advantages: Simpler queries (fewer joins), better performance for typical BI queries, easier for business users to understand. Disadvantages: Higher data redundancy (larger storage), harder to maintain when dimension attributes change frequently (must update multiple fact rows).
Snowflake schema advantages: Reduced storage via normalization, easier dimension maintenance (change hierarchy in one place). Disadvantages: More complex queries (additional joins), potential query performance degradation due to extra lookups.
b. Choose snowflake when: Storage costs are significant and dimensions have deep, stable hierarchies. Scenario: A national retail chain with 50+ product attributes (color, size, material, care instructions, country of origin, warranty info) where each attribute has its own table; the data warehouse stores years of history and storage optimization reduces costs by 30% versus fully denormalized star. Query writers accept slightly more complex JOINs because the analytics team primarily uses SQL views that hide the complexity.
Review Q&A
Q1: How does BI differ from a standard reporting system?
A1: Standard reporting typically presents historical data in fixed layouts (e.g., monthly PDFs, static spreadsheets). BI goes further: it enables interactive exploration, drill-down analysis, what-if scenarios, and integrates data from multiple sources into a unified view. BI platforms support slicing, dicing, pivoting, and combining metrics ad-hoc, whereas reporting systems deliver pre-defined snapshots. Additionally, BI leverages data warehouses and dimensional modeling for performance on large datasets, while reporting often queries operational databases directly, which can impact transaction systems.
Q2: When would you use a snowflake schema instead of a star schema?
A2: Choose snowflake when storage costs are a primary concern and dimension hierarchies are stable and deep. Snowflake reduces redundancy by normalizing dimension tables into related sub-tables. The trade-off is more complex queries requiring additional JOINs, which may impact performance for ad-hoc analysis. Many modern columnar warehouses with effective compression make the storage advantage less critical, so the decision should consider query patterns, user skill levels, and total cost of ownership, not just storage.
Q3: What's the difference between RANK() and DENSE_RANK() window functions?
A3: RANK() assigns sequential numbers with gaps after ties (1, 2, 2, 4). DENSE_RANK() assigns sequential numbers without gaps (1, 2, 2, 3). Use RANK() when you want to reflect the actual position in ordering (ties share rank, next rank reflects skipped count). Use DENSE_RANK() when you want continuous ranking without gaps, such as determining percentile buckets or top-N selections where tied items should share the same bucket.
Q4: Describe the BI lifecycle from data collection to dashboard dissemination.
A4: The BI lifecycle commences with data extraction from source systems (ERP, CRM, logs, APIs). Extraction feeds ETL processing: data cleaning, type conversion, derivation of calculated fields, and integration across sources via key reconciliation. Transformed data lands in a data warehouse, organized using dimensional modeling (star/snowflake schemas). OLAP operations enable multi-dimensional analysis (drill-down, slice-and-dice, pivoting). BI tools connect to the warehouse and generate interactive dashboards and reports for business users. Users explore, filter, and draw insights, which may trigger new questions, feeding back into the cycle. The loop continues with iterative analysis, additional data integration, and refined models.
Q5: What are key considerations for KPI design?
A5: Every KPI should be SMART: Specific, Measurable, Achievable, Relevant, Time-bound. Define the formula unambiguously (document calculation logic, data sources, grain). Assign targets with comparison benchmarks (prior period, industry average). Ensure data quality underpins the KPI (validate source data, monitor for drift). Limit the number of KPIs per team to 3–7 to maintain focus. Review and retire KPIs quarterly as strategy evolves.
Glossary
| Term | Definition |
|---|---|
| Analytics | The systematic computational analysis of data or statistics to discover patterns, trends, and insights for decision-making. |
| Data Warehouse | A centralized repository of integrated data from multiple sources, optimized for query and analysis rather than transaction processing. |
| Data Mart | A focused subset of a data warehouse, oriented to a specific business line, department, or subject area. |
| Dimensional Modeling | A data organization technique using fact tables (measurable events) and dimension tables (contextual attributes) to support BI queries. |
| ETL (Extract, Transform, Load) | Process of extracting data from source systems, transforming it into a suitable format, and loading it into a target repository (warehouse/mart). |
| KPI (Key Performance Indicator) | A measurable value that demonstrates how effectively an organization is achieving key business objectives. |
| OLAP (Online Analytical Processing) | Technology for multi-dimensional analysis of business data, enabling complex ad-hoc queries, drill-down, slice-and-dice, and pivoting. |
| Fact Table | Central table in a dimensional model containing measurable, quantitative data (metrics, facts) foreign-key linked to dimension tables. |
| Dimension Table | Descriptive attribute table that contextualizes fact table data (e.g., time, geography, product, customer). |
| Star Schema | Dimensional model where one fact table connects directly to multiple dimension tables; resembles a star. |
| Snowflake Schema | Normalized dimensional model where dimension tables are further normalized, creating a snowflake-like structure. |
| Descriptive Analytics | Analytic level answering "what happened?" through summary of historical data. |
| Diagnostic Analytics | Analytic level answering "why did it happen?" through root-cause analysis of descriptive results. |
| Predictive Analytics | Analytic level answering "what might happen?" using statistical models and machine learning on historical data. |
| Prescriptive Analytics | Analytic level answering "what should we do?" through optimization and recommendation models. |
| Dashboard | Interactive visual display of key metrics and trends, enabling at-a-glance monitoring and exploration. |
| Data Governance | Framework of policies, roles, and processes ensuring data quality, consistency, security, and compliance across the organization. |
| Data Quality | Condition of data being fit for use, measured by dimensions such as completeness, accuracy, consistency, timeliness, and uniqueness. |
| Provenance | Tracked origin and history of data, from source system to final report value, supporting audit and trust. |
| Chartjunk | Decorative elements in data visualization that do not convey information (Tufte's term), reducing effective data-to-ink ratio. |
| Grain | The level of detail at which facts are stored; one row represents one fact at a specific granularity (e.g., one sale, one enrollment). |
| Lead Indicator | Metric that predicts future outcomes; enables proactive adjustment. |
| Lag Indicator | Metric that confirms past results; validates whether leading indicators were effective. |
| Mermaid | A JavaScript-based diagramming and charting tool using text definitions in markdown; widely used for ER diagrams, flowcharts, and Gantt charts in documentation. |
References and Further Reading
- Kimball, R., & Ross, M. (2013). The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling (3rd ed.). Wiley.
- Davis, G. B. (2020). Business Intelligence Dashboards: Design, Development, and Implementation. Apress.
- Laudon, K. C., & Laudon, P. (2021). Management Information Systems: Managing the Digital Firm (16th ed.). Pearson.
- Power BI Documentation: https://learn.microsoft.com/power-bi/
- Tableau Documentation: https://www.tableau.com/learn/whitepapers
- Tufte, E. R. (2001). The Visual Display of Quantitative Information (2nd ed.). Graphics Press.
Important Disclaimer: This study guide is an original supplementary resource created for student support. It is not an official syllabus, verified TU outline, or approved course structure. The 2025 TU curriculum source confirms course identity (BCA405-II, semester 7, Business Intelligence) only and does not provide a detailed unit outline. All topic coverage is independently generated for learning support purposes. Students should consult official course materials, instructors, and the TU curriculum document for examination purposes. Generated 2026-11-20.