Now, you can watch the Data warehouse concepts Interview Questions and Answers in YouTube videos, CLICK HERE
What is a data warehouse?
A data warehouse is a database which,
1.Maintains history of data
2.Contains Integrated data (data from multiple business lines)
3.Contains Heterogeneous data (data from different source formats)
4.Contains Aggregated data
5.Allows only select to restrict data manipulation
6.Data will be stored in de-normalized format
Definition of a data warehouse:
Main Usage of a data warehouse:
1. Data Analysis
2. Decision Makings
3. Planning or Forecasting
What is a dimension?
A Dimension table is a table where it contains only non-quantifying data and category of information which are key for analysis. A dimension table contains primary key and non-quantifying columns. If the primary key does not exist in source table then surrogate key would exist.
What are the types of dimension?
Based on what type of data it stores there is two major types dimension table,
Based on where it’s being derived there is one dimension category,
Based on how frequently the data in the dimension can be divided into 2 types,
4.Rapidly Changing Dimension (RCD)
5.Slowly Changing Dimension (SCD)
What is a fact and what are the types of fact?
A fact is a column or attribute which can be quantifiable or measurable and will be used as key analysis factor. We can call it as a measure.
What does a fact table contain?
A table which contains facts is called fact table. Typically a fact table has facts and foreign keys of dimension tables.
Fact table structure:
What are the types of a fact table?
The fact table will contain data’s in very detail level without any rollup/aggregation the way how transactional database stores.
Accumulating refers storing multiple entries for a single record to track the changes throughout the workflow.
The data will be extracted and loaded for a particular period of a time. It describes what would be the state of the record in that specific period.
Factless fact table
When a fact table does not have any fact is called Factless fact table. It has only foreign keys of dimension tables.
- To reduce the complexity of Job (It will be more complex when we move directly from Source to Target)
- To avoid the source database update.
- To perform any calculations.
- To perform data cleansing process as per business need.
- When the data has been corrupted in Target after the load, we can delete the corrupted data in Target database after that we can just load the unloaded/deleted data alone into Target from staging database.
What is a surrogate key?
In most of the table, the primary key will be loaded from source schema, but some source table might not have a primary key in such has by using sequence generator the primary key will be created, such keys are called Surrogate key.
In terms of usage, there is no difference between these two types of keys. Both differ in the way of loading primary key loaded from the source table, whereas surrogate key loaded by the sequence generator.
OLTP vs DW database
Dedicated database available for specific subject area or business application
|Integrated from different business applications|
It does not keep history
It keeps history of data for analyzing past performance
It allows user to perform the below DML operations (Select, Insert, Update,Delete)
It allows only Select for end users
The main purpose is for using day to day transactions
Purpose is for analysis and reporting
Data volume will be less
Data volume is huge
|Data stored in normalized format||
Data stored in de-normalized format
Explain about star schemaOperational Data Store (ODS) vs Staging database
It will have limited period of data (30 to 90 days)
|Based on type of load it stores incremental data or full volume of data|
Temporary data storage and for doing data cleansing and other calculations
|Integrated from different business lines||
Based on business need, normally the each business line would have dedicated staging
This type schema contains the fact table in center position. As we know that fact table contains a reference to dimension tables. Then the fact table will be surrounded by dimension tables with foreign key reference. The dimension table will not have a reference with any other dimension.
Explain about snowflake schema
This type also contains a fact table in center position. The fact table has a reference to dimension tables. The dimension table will have a reference to another dimension. The data will be stored in the more normalized form.
What is the difference between star and snowflake?
As there is no relationship between dimensions to other dimensions the performance will be high.
|Due to multiple links between dimensions the performance will be low.|
|The number of joins will be less which makes query complexity low||
The number of joins will be more which makes query complexity high
Consider the Project dimension mentioned in above example it has Role column where the Role name value will be stored against for each project in case of start schema, the size of the table will be high
|The role information is separately stored in a table and the reference will be linked in Project dimension, it reduces the table size|
|Data will be stored in de-normalized format in dimension table||
Data will be stored in more normalized format in dimension tables
What is data cleansing?
Data cleansing is a process of removing irrelevant and redundant data, and correcting the incorrect and incomplete data. It is also called as data cleaning or data scrubbing. All organizations are growing drastically with huge competitions, they take business decisions based on their past performance data and future projection
What is data masking?
What does data masking mean? Organizations never want to disclose highly confidential information into all users. All sensitive data will be restricted to access in all environments other than production. The process of masking/hiding/encrypting sensitive data is called data masking.
Can you list down the challenges you have faced?
The data warehouse database contains integrated data for all business lines, for example, a banking data warehouse contains data for all saving, credit and loan accounts databases.
The reporting access level will be given to a person who has authority or needs to see the comparison of data for all three types of accounts.
Meanwhile, a loan account branch manager does not require to see the saving and credit card details, he wants to see only the past performance of loan account alone.
In that case for his analysis, we need to apply data level security to protect saving and credit information’s data warehouse.
At the same time, the number of end users across three accounts will access the same data warehouse, it will end up in poor performance.
To avoid these issues, the separate database will be built on top of data warehouse, named as the data mart. The access will be given for respective business line resources not for everyone.
What is data purging and archiving?
Data purging means deleting data from a database which crosses the defined retention time.
Archiving means moving the data which crosses the defined retention time to another database (archival database).
What are the types of SCD?
SCD Type 1
-Modifications will be done on the same record
-Here no history of changes will be maintained
SCD Type 2
-An existing record will be marked as expired with is_active flag or Expired_date column
-This type allows tracking the history of changes
SCD Type 3
-A new value will be tracked as a column
-Here history of changes will be maintained
What type of schema and SCD type used in your project?
In my current project, we are using type2 to keep the history of changes.
Now you can watch the Interview Questions in YouTube videos,
If you want to learn with an example project about all concepts and end to end process, learn easily with a business project.
You can follow about ETL testing automation stuff at, Automating ETL test cases without any tool?
“Subscribe here to get the new posts,