Data Modelling Questions with Answers

23 practice questions on Data Modelling (Data Engineering) with answers and step-by-step solutions. Try 10 samples below, then practise all 23 free in the AptiNest app.

Sample questions

Question 1Easy

A customer's segment changes 3 times after first being loaded into an SCD Type 2 dimension. How many rows does that customer have?

  1. 3
  2. 4
  3. 1
  4. 6

Answer: B. 4

Explanation

One original row plus one new row per change: 1 + 3 = 4, with exactly one marked current.

Step-by-step solution

  1. The first load gives 1 row.
  2. Each of 3 changes adds a row.
  3. Total is 4 rows.

Why the other options are wrong

  • A. 3 omits the first row.
  • C. One row is Type 1.
  • D. 6 is wrong.

Tip: Rows = changes + 1.

Question 2Easy

SCD Type 2 handles a customer moving from Pune to Mumbai by:

  1. Deleting the customer and re-inserting them
  2. Adding a new row and closing the old row's validity
  3. Overwriting the city in the existing row
  4. Storing the old city in a previous_city column next to the current city

Answer: B. Adding a new row and closing the old row's validity

Explanation

Each version has its own surrogate key and validity range, so facts keep the city at the time they happened.

Step-by-step solution

  1. SCD Type 2 preserves history.
  2. It adds a new row for the change.
  3. The old row's end date is closed.

Why the other options are wrong

  • A. Deleting loses history.
  • C. Overwriting is Type 1.
  • D. A previous column is Type 3.

Tip: Type 2 = new row.

Question 3Easy

Why are star schemas popular for BI dashboards?

  1. They remove the need to aggregate data
  2. They allow only one table per database
  3. They store data with no keys at all
  4. Queries need few joins and are easy to understand

Answer: D. Queries need few joins and are easy to understand

Explanation

Facts join directly to a handful of dimensions, which suits slicing and filtering.

Step-by-step solution

  1. Star schemas have a central fact table with many dimension tables.
  2. Queries connect to the fact table with few joins.
  3. Fewer joins make queries faster and easier to read.
  4. This simplicity helps in creating clear BI dashboards.
  5. Queries need few joins and are easy to understand.

Why the other options are wrong

  • A. Star schemas still need aggregation for many dashboards; they do not remove the need to aggregate.
  • B. Star schemas use a central fact table with many dimension tables, not one table per database.
  • C. Star schemas join facts and dimensions with keys; they do not store data with no keys at all.

Question 4Easy

SCD Type 1 handles a changed attribute by:

  1. Adding a new row with validity dates
  2. Adding a column for the previous value
  3. Overwriting the old value, keeping no history
  4. Rejecting the change and keeping the old value

Answer: C. Overwriting the old value, keeping no history

Explanation

Type 1 is simple but loses history; use it for corrections or attributes where history does not matter.

Step-by-step solution

  1. SCD Type 1 handles a changed attribute by overwriting the stored value.
  2. No previous value and no extra row are kept.
  3. This is simple, but the old value and its history are lost.
  4. The correct answer is option C: overwriting the old value, keeping no history.

Why the other options are wrong

  • A. Adding a new row with validity dates is SCD Type 2.
  • B. Keeping a column for the previous value is SCD Type 3.
  • D. Type 1 applies the change; it does not reject it.

Tip: Type 1 overwrites, Type 2 adds a new row, Type 3 keeps a previous-value column.

Question 5Medium

Denormalising dimensions in an analytical model is acceptable because:

  1. Normalised tables cannot store numeric data, only descriptive text values
  2. Denormalised data never contains duplicates
  3. Warehouses do not support joins between tables
  4. Reads dominate and fewer joins make queries simpler and faster

Answer: D. Reads dominate and fewer joins make queries simpler and faster

Explanation

OLAP favours read performance; update anomalies matter less in batch-loaded models.

Step-by-step solution

  1. Reads are more frequent than writes in analytical systems.
  2. Fewer joins reduce query complexity and speed up execution.
  3. Denormalised data simplifies query processing for large datasets.
  4. This makes denormalisation acceptable in analytical models.
  5. Final answer: Reads dominate and fewer joins make queries simpler and faster.

Why the other options are wrong

  • A. Normalised tables can store numbers; normalisation does not restrict tables to text values.
  • B. Denormalised data does contain duplicates, since the same values repeat across rows.
  • C. Warehouses do support joins; denormalising is a choice to reduce them, not a limit of the warehouse.

Tip: In analytics, read speed matters more than write accuracy.

Question 6Medium

Given fact_sales(product_key, amount) with rows (1, 100), (2, 50), (1, 70) and dim_product rows (1, 'Books') and (2, 'Toys'), what does this return for Books?

SELECT p.category, SUM(f.amount)
FROM fact_sales f JOIN dim_product p ON f.product_key = p.product_key
GROUP BY p.category;
  1. 220
  2. 100
  3. 70
  4. 170

Answer: D. 170

Explanation

Books has product_key 1, which has amounts 100 and 70: 170.

Step-by-step solution

  1. The query joins fact_sales to dim_product on product_key.
  2. Books is product_key 1, and the fact rows for key 1 have amounts 100 and 70.
  3. SUM over the Books group gives 100 plus 70, which is 170.
  4. The correct answer is option D: 170.

Why the other options are wrong

  • A. 220 adds in the Toys amount of 50 as well, which does not belong to Books.
  • B. 100 is only the first fact row for Books.
  • C. 70 is only the second fact row for Books.

Tip: A GROUP BY sums only the rows whose keys match each group.

Question 7Medium

SCD Type 3 tracks change by:

  1. Adding a new row for each change, with start and end dates on every row
  2. Never changing the original value once it is loaded
  3. Keeping a column for the previous value alongside the current one
  4. Moving history to a separate audit database

Answer: C. Keeping a column for the previous value alongside the current one

Explanation

Type 3 keeps limited history, usually just one prior value.

Step-by-step solution

  1. SCD Type 3 adds a column that holds the previous value next to the current one.
  2. This keeps limited history, usually just one prior value.
  3. A new row for each change with dates is Type 2, not Type 3.
  4. The correct answer is 2: a column for the previous value alongside the current one.

Why the other options are wrong

  • A. A new row per change with start and end dates is SCD Type 2.
  • B. Never changing the original value is not a slowly changing dimension type.
  • D. Type 3 keeps the history in the same table, not in a separate audit database.

Tip: Type 3 keeps one prior value in a column; use Type 2 when full history is needed.

Question 8Medium

Declaring the grain of a fact table means stating:

  1. Which team owns the table in the company and who approves changes to it
  2. Which team owns the table in the company
  3. How many columns the table is allowed to have
  4. What one row represents, such as one line item per order

Answer: D. What one row represents, such as one line item per order

Explanation

Grain is the first design decision; every measure and dimension must match it.

Step-by-step solution

  1. Grain defines what each row in the fact table represents.
  2. It specifies the level of detail stored in the table.
  3. For example, one row could represent one line item per order.
  4. This ensures all data aligns with the business requirement.
  5. The correct answer is What one row represents, such as one line item per order.

Why the other options are wrong

  • A. Team ownership and approval are governance details, not the grain of a fact table.
  • B. Naming the owning team says nothing about the level of detail in each row.
  • C. The number of columns is not the grain; grain is what one row represents.

Tip: Remember grain defines the smallest unit of data stored in a fact table.

Question 9Hard

A conformed dimension is one that:

  1. Has been converted from CSV into Parquet format
  2. Is shared with the same keys and meaning across several fact tables
  3. Contains only columns approved by the legal team
  4. Is rebuilt from scratch every night by default, so it never drifts from the source

Answer: B. Is shared with the same keys and meaning across several fact tables

Explanation

Conformed dimensions such as date or customer let metrics from different facts be compared and combined.

Step-by-step solution

  1. Conformed dimensions share same keys and meaning across fact tables.
  2. This ensures consistency when combining data from different sources.
  3. Shared keys and meaning allow accurate comparisons between facts.
  4. Option B describes this exact definition.
  5. Final answer: Is shared with the same keys and meaning across several fact tables.

Why the other options are wrong

  • A. Changing a file format from CSV to Parquet does not make a dimension conformed; shared keys and meaning do.
  • C. Legal approval of columns is not the definition; conformed means shared keys and meaning.
  • D. Rebuilding nightly does not make a dimension conformed or stop drift; shared meaning is what matters.

Tip: Remember: Conformed dimensions are consistent across facts for accurate comparisons.

Question 10Hard

An account balance measure in a daily snapshot fact table is semi-additive because:

  1. It can be summed across accounts but not across days
  2. It is stored as text and must be cast first
  3. It can be summed across days but not across accounts
  4. It can never be summed or averaged in any way

Answer: A. It can be summed across accounts but not across days

Explanation

Summing a balance over days double-counts; use the closing value or an average over time.

Step-by-step solution

  1. A balance is a point-in-time value, such as the closing balance of an account.
  2. Adding balances across accounts gives a meaningful total at one point in time.
  3. Adding the same balance across days double-counts it, so it is not summed over time.
  4. The correct answer is option A: it can be summed across accounts but not across days.

Why the other options are wrong

  • B. Storage as text is not the reason the balance is semi-additive.
  • C. This is reversed: balances add across accounts but not across days.
  • D. Balances can be averaged over time, so they are not impossible to combine.

Tip: Semi-additive measures can be summed across some dimensions, such as accounts, but use last or average values across time.

Practise all 23 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Data Engineering topics · All topics