Questions tagged [star-schema]

Star schema is the most basic data warehousing dimensional structure and database schema, consisting of one or more fact tables referencing any number of dimension tables.

Star schema is the most basic data warehousing (data mart) dimensional structure and database schema, consisting of one or more fact tables referencing any number of dimension tables. It is organized like:

  • Facts - event that is counted or measured. They can be at a very atomic level. Generally assigned a surogate key to ensure every row can be identified.
  • Dimensions - reference information about facts. The records contain detailed information and attributes describing the fact data. Usually assigned a surrogate primary key.

Within the data warehouse and data mart the dimension table is associated with fact tables using foreign key relationship.

Advantages

In well-designed schemas multidimensional data can be analyzed easily. They are good in decision-support environments. Some of the advantages are query speed, data load and administration. The built-in referential integrity is good but not as in highly normalized databases though.

Examples

An example star schema could have a Sales Fact with Date, Product, and Store Dimensions. Any numerical performance measurements related to Sales would also be stored in the fact, like "Quantity Sold" and "Dollar Amount of Sale". The remaining columns in the Sales Fact would be foreign keys linking to the Dimensions.

More information

354 questions
0
votes
1 answer

HR Data Mart Design Advice

I am working on a design for an HR data mart using the Kimball approach outlined in 'The Data Warehouse Toolkit'. As per the Kimball design, I was planning to have a time-stamped, slowly-changing dimension to track employee profile changes (to…
brymann
  • 1
  • 2
0
votes
2 answers

How to store purchase metadata in a data warehouse

Suppose my company sells many products, eg domains, t-shirts and vans. In my current data warehouse star schema design, I have a fact table for invoice items with the following (slightly simplified) schema fact_invoice_item id |…
dbatten
  • 437
  • 5
  • 18
0
votes
1 answer

Should we put all the fields related to the `user` in a `dim_user` table in a data warehouse?

Considering there is a data warehouse contains one fact table and three dimension tables. Fact table: fact_orders Dimension tables: dim_user dim_product dim_date All the data of these tables are extracted from our business systems. In the…
mingchau
  • 450
  • 3
  • 12
0
votes
1 answer

Handling multiple grains within a star schema

I'm trying to model a business process that is inherently measured at multiple grains. Usually, this would necessitate one fact table per grain. Because this a single business process and only one of the dimensions is at a mixed grain (for some…
0
votes
2 answers

Split fact table because of one missing foreign key?

Imagine that we have two different messages: CarDataLog CarStatusLog CarDataLog contains data which has a direct relation to a car and the corresponding Person and contains data about the car. CarStatusLog contains data about the same car as…
Rvh
  • 43
  • 6
0
votes
1 answer

How to convert pivot column structure to dimension table

I want to convert a table structure with pivoted columns into a dimension table and fact table. how to create a medication dimension table from the data with below structure with model enforcing star schema
0
votes
1 answer

Problems with Column in Fact Table

I'm building a DW just like the one from AdventureWorks. I have one fact table called FactSales and theres a table in the database called SalesReason that tells us the reason why a certain costumer buys our product. The thing is there are two types…
0
votes
1 answer

Handling complex SQL statements with Python and SQLAlchemy

I am building an analytics page backed up with Python(Flask) and Redshift as data source. Data is presented in a start schema, so all I want to do is basic aggregation and filtering in specified time frame (sounds not like a rocket science). Though…
Semant1ka
  • 647
  • 10
  • 26
0
votes
1 answer

Reaffecting dimension of fact table

I am starting to build a star schema, and I like it ^^ I have a design problem with dimensional modeling. I have a Fact table for each transaction in the star schema (highest grain) Something like that (simplified version) transaction_facts - id -…
nemenems
  • 1,064
  • 2
  • 9
  • 27
0
votes
0 answers

Power BI - Data Modeling

I recently came across the star schema and its advantages. I am new to Power BI and Database modeling. I am making a Power BI Report. I planned hours for all my members in my team for each Project and thus calculated the hours spent with their…
Light
  • 3
  • 4
0
votes
1 answer

Most efficient way to set a default value in the fact table of a star schema in SQL Server

I've built a star schema with a number of dimensions, but I'd like to set a default value of 0 for the fact table if no matching value is found for that dimension. Here's my current solution: Left join and case statements SELECT CASE WHEN d1.ID…
user3457834
  • 314
  • 3
  • 12
0
votes
1 answer

Datawarehouse - star schema for car accidents

To be honest I am completely new to Data Warehouse practices and as an assignment, I need to design a data warehouse using star-schema for car accidents in a country. At first, I have designed the FactTable as Accident with measures QtyCars and…
0
votes
1 answer

What can I improve in this dimensional model?

Hi, I am new to Kimball Dimensional Modeling. I'm wondering if someone could give me some feedback as to what I can improve in this star schema model? It's a model with a grain of one row per payment, per customer. It also has a customer dimension…
PJ.SQL
  • 343
  • 2
  • 10
0
votes
2 answers

Fixing Redundancy of Data in Power BI

Currently I'm working with a dashboard in which I'm pulling data (this data comes from 2 tables or dimensions) from a star schema, I'm displaying the data in a table component, and this data is not being displayed correctly because it looks like…
Jplaudir8
  • 143
  • 1
  • 6
  • 18
0
votes
2 answers

Creating star schema from csv files using Python

I have 6 dimension tables, all in the form of csv files. I have to form a star schema using Python. I'm not sure how to create the fact table using Python. The fact table (theoretically) has at least one column that is common with a dimension table.…
pack24
  • 105
  • 1
  • 10