A star schema is a simple database design where a central fact table connects to multiple dimension tables, forming a star-like shape. It helps organize data for easy and fast analysis.
Click to reveal answer
beginner
What is the role of the fact table in a star schema?
The fact table stores measurable, quantitative data like sales or revenue. It links to dimension tables using keys and contains numeric values used for calculations.
Click to reveal answer
beginner
What are dimension tables in a star schema?
Dimension tables hold descriptive information like product names, dates, or customer details. They provide context to the numbers in the fact table.
Click to reveal answer
beginner
Why is the star schema called 'star'?
Because the fact table is at the center and dimension tables spread out around it like points on a star, making the structure look like a star shape.
Click to reveal answer
intermediate
How does a star schema improve query performance?
It simplifies joins by having one central fact table connected directly to dimension tables, reducing complexity and speeding up data retrieval.
Click to reveal answer
In a star schema, what type of data does the fact table usually contain?
AUser login details
BDescriptions like product names
CQuantitative measurements like sales amounts
DDatabase configuration settings
✗ Incorrect
The fact table contains measurable data such as sales or revenue, which are quantitative.
Which of the following best describes dimension tables?
ATables that provide descriptive context
BTables that store numeric facts
CTables that store system logs
DTables that hold temporary data
✗ Incorrect
Dimension tables provide descriptive information like product or customer details.
Why is the star schema design popular in BI systems?
AIt uses many complex joins
BIt simplifies queries and improves performance
CIt stores unstructured data
DIt requires no indexing
✗ Incorrect
Star schema simplifies queries by having a central fact table connected to dimension tables, improving performance.
What shape does the star schema resemble?
ACircle
BSquare
CTriangle
DStar
✗ Incorrect
The schema looks like a star with the fact table in the center and dimension tables around it.
Which key connects the fact table to dimension tables?
AForeign key in fact table
BNo keys are used
CPrimary key in dimension table only
DPrimary key in fact table
✗ Incorrect
The fact table contains foreign keys that link to primary keys in dimension tables.
Explain the structure and components of a star schema in simple terms.
Think about a central table with spokes connecting to descriptive tables.
You got /4 concepts.
Describe how a star schema helps improve data analysis and query speed.
Focus on how the design reduces complexity in queries.
You got /4 concepts.
Practice
(1/5)
1. What is the main characteristic of a star schema in a data warehouse?
easy
A. One central fact table connected to multiple dimension tables
B. Multiple fact tables connected to one dimension table
C. Only dimension tables without any fact tables
D. A flat table with no relationships
Solution
Step 1: Understand star schema structure
A star schema has a central fact table that stores measurable data.
Step 2: Identify dimension tables role
Dimension tables surround the fact table and provide descriptive attributes.
Final Answer:
One central fact table connected to multiple dimension tables -> Option A
Quick Check:
Star schema = central fact + many dimensions [OK]
Hint: Fact table is the center, dimensions are spokes [OK]
Common Mistakes:
Confusing fact and dimension tables
Thinking star schema has multiple fact tables
Assuming no relationships exist
2. Which SQL JOIN type is typically used to connect fact and dimension tables in a star schema?
easy
A. INNER JOIN
B. LEFT JOIN
C. FULL OUTER JOIN
D. CROSS JOIN
Solution
Step 1: Understand fact-dimension relationship
Fact tables usually have matching keys in dimension tables.
Step 2: Choose JOIN type for matching rows
INNER JOIN returns only matching rows, ideal for star schema queries.
Final Answer:
INNER JOIN -> Option A
Quick Check:
Fact and dimension use INNER JOIN [OK]
Hint: Use INNER JOIN to link matching keys [OK]
Common Mistakes:
Using CROSS JOIN which multiplies rows
Using FULL OUTER JOIN causing unnecessary nulls
Using LEFT JOIN when INNER JOIN suffices
3. Given a star schema with a fact table Sales and dimension table Product, what does this SQL query return?
SELECT p.ProductName, SUM(s.SalesAmount) AS TotalSales
FROM Sales s
JOIN Product p ON s.ProductID = p.ProductID
GROUP BY p.ProductName;
medium
A. Sales amount grouped by sales date
B. Total sales amount for each product
C. Total sales amount for all products combined
D. List of products without sales data
Solution
Step 1: Analyze JOIN and GROUP BY
The query joins Sales and Product on ProductID and groups results by product name.
Step 2: Understand aggregation
SUM(s.SalesAmount) calculates total sales per product group.
Final Answer:
Total sales amount for each product -> Option B
Quick Check:
GROUP BY product sums sales per product [OK]
Hint: GROUP BY product sums sales per product [OK]
Common Mistakes:
Ignoring GROUP BY causing total for all products
Confusing JOIN keys
Assuming query lists products without sales
4. Identify the error in this SQL query using a star schema:
SELECT d.CustomerName, SUM(f.SalesAmount)
FROM FactSales f
JOIN DimProduct d ON f.ProductID = d.ProductID
GROUP BY d.CustomerName;
medium
A. JOIN uses wrong dimension table alias
B. GROUP BY column not in SELECT
C. SUM aggregation missing alias
D. JOIN condition uses wrong keys
Solution
Step 1: Check JOIN condition keys
FactSales.ProductID should join with DimProduct.ProductID, but SELECT and GROUP BY use CustomerName from a different dimension.
Step 2: Identify mismatch in dimension usage
CustomerName likely belongs to DimCustomer, not DimProduct, so JOIN keys are incorrect.
Final Answer:
JOIN condition uses wrong keys -> Option D
Quick Check:
JOIN keys must match correct dimension [OK]
Hint: Match JOIN keys to correct dimension table [OK]
Common Mistakes:
Grouping by column not selected
Using alias inconsistently
Missing aggregation alias
5. You want to design a star schema for sales data including customers, products, and time. Which approach best supports fast queries and easy analysis?
hard
A. Store all data in one big table without relationships
B. Create multiple fact tables for each dimension and one large dimension table
C. Create one fact table for sales and separate dimension tables for customers, products, and time
D. Use normalized tables with many joins instead of star schema
Solution
Step 1: Understand star schema design principles
Star schema uses one fact table for measurable events and multiple dimension tables for descriptive data.
Step 2: Evaluate options for query speed and simplicity
Create one fact table for sales and separate dimension tables for customers, products, and time matches star schema best, enabling fast joins and simple queries.
Final Answer:
Create one fact table for sales and separate dimension tables for customers, products, and time -> Option C
Quick Check:
Star schema = 1 fact + many dimensions [OK]
Hint: One fact table, many dimension tables for star schema [OK]
Common Mistakes:
Using multiple fact tables unnecessarily
Flattening all data into one table
Choosing normalized schema over star schema for BI
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.