0% found this document useful (0 votes)
2 views6 pages

SQL

A data warehouse is a subject-oriented, integrated, non-volatile, and time-variant repository designed for analysis, utilizing dimensional modeling with facts and dimensions. The star schema organizes data with a central fact table linked to dimension tables, facilitating complex queries for decision-making in OLAP systems compared to transactional OLTP systems. Constraints such as unique, null, and primary key ensure data integrity, while referential constraints maintain relationships between tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

SQL

A data warehouse is a subject-oriented, integrated, non-volatile, and time-variant repository designed for analysis, utilizing dimensional modeling with facts and dimensions. The star schema organizes data with a central fact table linked to dimension tables, facilitating complex queries for decision-making in OLAP systems compared to transactional OLTP systems. Constraints such as unique, null, and primary key ensure data integrity, while referential constraints maintain relationships between tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Data warehouse is a collection of data.

It has the following properties:

 Subject-oriented: A data warehouse should contain information about a few well-

defined subjects rather than the enterprise.

 Integrated: A data warehouse is an integrated repository of data. It contains

information from various systems within an organisation.

 Non-volatile: The data values in a database cannot be changed without a valid reason.

 Time-variant: A data warehouse contains historical data for analysis.

Primary methods of designing a data warehouse is dimensional modelling.


The two key elements of dimensional modelling include facts and dimensions,.
They are arranged in a specific manner, known as a schema diagram.
Facts : numerical data in the data warehouse.
Dimensions:Are the metadata attached to the fact variables.
Facts and Dimensions
Consider a bank that has thousands of ATMs across India. In every
transaction, the following variables are recorded:

1. Withdrawal amount
2. Account balance after withdrawal
3. Transaction charge amount
4. Customer ID
5. ATM ID
6. Date of withdrawal
Which of the variables above are fact variables (select all that apply)?

Ans: Withdrawl Amount,Transaction charge amount,Account balance after withdrawl

Dimensional Modelling
What are the benefits of having dimension variables apart from facts?

1. It helps with performing various types of analyses, such as


sector-wise, country-wise or funding-type-based analyses.

2. It helps with extracting specific, useful information, such as the


total investment made in the Automobile sector in India between
2014 and 2015
Star Schema
A schema is an outline of an entire database.
It shows how different datasets are connected and how different
attributes of each data set are used for datawarehouse.
1. A fact table is at centre surrounded by different dimension
tables.
2. Fact table maintain many to one relation with all dimension
tables.
3. Every row in a fact table is associated with its dimension
table rows with a foreign key reference.
4.

Star Schema
Question :In a star schema, what is the name of the table that
contains the metadata that is needed for analysing
numerical/quantitative data?

Answer: Dimension table


OLAP vs OLTP
Online Analytical Processing and Online Transaction Processig

Transaction Database Data Warehouse

Purpose To perform business To conduct analysis and


transactions decision making

User End users for business Managers,CEOs,CXO’s


transactions for decision making

Technolog 1.No ETL Process 1.ETL Process -


y Extract,Transorm and
2.DBMS Load process

3.Server Side
Application-API

Front end 1.Web servers 1.BI Tools:


technolog
y 2.Browsers for a.Congo
interaction
b.Tableau
3.Mobile phones
3.Reporting front end
4. Interface with information
payment gateways

Database 1. Based on integrity 1.Based on dimensional


Design issues and modelling
normalization
2. No start schema 2.Creation of star
3. CRUD- schema
Create,Update,Retri
eve and Delete 3.Reporting front end
infrastructure

Also OLTP OLAP


Known As

Questions:
OLAP vs OLTP
Which of the following statement(s) is/are true? More than one option may
be correct.

1. In OLAP systems, data is taken from a single data source.


2. Compared with OLTP, OLAP systems use complex queries to
perform tasks, because in OLAP, we perform analysis on
various tables and it needs complex queries.
3. OLAP systems use ETL.
OLAP systems need data from different data sources. Before all the
data is collected, we need to ensure that the interpretation of the
data from different data sources is the same and that it is loaded
into the data warehouse structure.
4. Schemas are an essential part of creating OLAP systems.
Schema diagrams are essential for creating a data warehouse
design. They indicate how the fact and dimension tables will be
connected.

OLAP vs OLTP
List the types of databases that are used to perform each of the following
operations:

1. Making a purchase
2. Withdrawing cash from an ATM
3. Finding the average sales of a local store
4. Finding profits by region for a specific product of a food MNC
Ans:

1. Transactional
2. Transactional
3. Transactional
4. OLAP

OLAP vs OLTP
Choose the correct statement from the following options given below:

Data is stored differently in a transactional database and a data


warehouse database.

SETL: Select, Extract, Transform and Load.

 Select: Identification of the data that you want to analyse

 Extract: Connecting to the particular data source and pulling out the data
 Transform: Modifying the extracted data to standardise it

 Load: Pushing the data into the data warehouse

Constraints are the rules that are used in MySQL to restrict the values that can be
stored in the columns of a database. This ensures data integrity, which is nothing
but the accuracy and consistency of the data stored in the database.

Entity constraints are of the following different types:

 Unique: This constraint is used for columns that need unique values. For example,

'employee ids' should be unique in an 'employees' table.

 Null: This constraint is used to determine the columns that can have null values. For

example, an employee may not need to specify their location, which means the

'location' column can have null values in an 'employees' table.

 Primary Key: This constraint is used to determine the column that uniquely identifies

a table. For example, 'employee ids' uniquely identify every employee. Two

employees may have the same name or the same salary, but not the same employee id.
Primary Keys
A primary key constraint always enforces both the UNIQUE and NOT NULL
constraints.

Use of Entity Constraints


Entity constraints are used to:

Ensure that duplicate records are not entered into the table.

✓ Correct
Feedback:
The UNIQUE constraint is a type of entity constraint that ensures
uniqueness of a column in a table.

Referential constraints: These are used to restrict the values that are taken by a
column in one table based on the values that exist in another table.

Note: A given table has only one primary key but it can have multiple foreign
keys. Before you assign a column as a foreign key, you need to ensure that the
primary key column of the table that it refers to is present and it does not have
null or duplicate values.
An Example of a Referential Constraint
Which of the following scenarios would require using a referential
constraint?

a. All phone numbers should contain the area code.


b. Certain fields are mandatory to fill (such as phone number)
before the record is accepted in a database.

c.Information on a customer must be known before anything can


be sold to that customer, so that you can refer to other fields to
get the information of the customers.
Feedback:
This would constitute a foreign key constraint, which is a referential
constraint. This is because customer details are required before a
particular product can be associated with the customer who placed the
order for that product.

d. When entering the card number for payment, the user must
input a 16-digit number.

You might also like