Docsity

Understand Computer Science, Summaries of Computer Science

Toggle sidebar
bg1
Lecture-1 Structured Questions & Answers
1. What is a Data Warehouse (DWH), and how does it fundamentally differ from an
operational database?
A Data Warehouse is a centralized repository that integrates data from multiple heterogeneous
sources. It is designed for analytical operations like OLAP and data mining to support decision-
making, not for day-to-day transaction processing.
Key Differences with Examples:
Purpose: An operational database (e.g., an Order Entry system) is for running the business
(recording a new sale). A DWH is for managing the business (analyzing sales trends over the last
year).
Data Nature: Operational systems hold current, transactional data (e.g., the current stock level of a
product). A DWH holds historical, time-variant data (e.g., snapshots of stock levels at the end of
each day for the past 5 years).
Operations: Operational systems frequently use Create, Read, Update, Delete (CRUD) operations.
A DWH is primarily non-volatile; data is loaded and then only read for analysis, not updated.
2. According to Bill Inmon, a data warehouse must have four key characteristics. What are
they?
Subject-Oriented: Organized around key business subjects, not applications.
Example: Instead of separate databases for "Order Processing" and "Customer Billing," a DWH
has integrated subjects like "Customer," "Product," and "Sales."
Integrated: Data from different sources is combined into a consistent format.
Example: In one system, a customer's gender might be stored as "M/F," and in another as "1/0."
In the DWH, this is integrated into a single, standard representation like "Male/Female."
Non-Volatile: Once data enters the warehouse, it is not updated or deleted. New data is appended,
creating a historical record.
Example: When a customer's address changes, the operational system is updated. The DWH keeps
the old address as part of the historical record for that customer's sales.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Understand Computer Science and more Summaries Computer Science in PDF only on Docsity!

Lecture- 1 Structured Questions & Answers

1. What is a Data Warehouse (DWH), and how does it fundamentally differ from an operational database? A Data Warehouse is a centralized repository that integrates data from multiple heterogeneous sources. It is designed for analytical operations like OLAP and data mining to support decision- making, not for day-to-day transaction processing. Key Differences with Examples: Purpose: An operational database (e.g., an Order Entry system) is for running the business (recording a new sale). A DWH is for managing the business (analyzing sales trends over the last year). Data Nature: Operational systems hold current , transactional data (e.g., the current stock level of a product). A DWH holds historical , time-variant data (e.g., snapshots of stock levels at the end of each day for the past 5 years). Operations: Operational systems frequently use Create, Read, Update, Delete (CRUD) operations. A DWH is primarily non-volatile ; data is loaded and then only read for analysis, not updated. 2. According to Bill Inmon, a data warehouse must have four key characteristics. What are they? Subject-Oriented: Organized around key business subjects, not applications. Example : Instead of separate databases for "Order Processing" and "Customer Billing," a DWH has integrated subjects like "Customer," "Product," and "Sales." Integrated: Data from different sources is combined into a consistent format. Example : In one system, a customer's gender might be stored as "M/F," and in another as "1/0." In the DWH, this is integrated into a single, standard representation like "Male/Female." Non-Volatile: Once data enters the warehouse, it is not updated or deleted. New data is appended, creating a historical record. Example: When a customer's address changes, the operational system is updated. The DWH keeps the old address as part of the historical record for that customer's sales.

Time-Variant: All data is associated with a specific period, allowing for historical analysis. Example: You can query the DWH to see "Total Sales per Product for each quarter of the last 3 years," which is not possible in a system that only holds the current order.

3. What are the two main approaches to integrating heterogeneous databases, and which one is used by modern data warehouses? Query-Driven Approach (Traditional): When a query is made, a mediator queries all the underlying source databases in real-time, integrates the results, and returns the answer. This is inefficient for complex or frequent queries. Update-Driven Approach (Modern): Data from multiple sources is integrated in advance, cleaned, transformed, and stored in the warehouse. Queries are then run directly against this pre- integrated data, which is much faster and more efficient. Modern data warehouses use this approach. 4. What are the key functions of Data Warehousing Tools and Utilities? The key functions form the ETL (Extract, Transform, Load) process and maintenance are: Data Extraction: Gathering data from various sources (e.g., relational databases, flat files). Data Cleaning: Finding and correcting errors (e.g., fixing misspelled city names, standardizing date formats). Data Transformation: Converting data from its source format to the warehouse format (e.g., converting currencies to a standard like USD, merging fields). Data Loading: Sorting, summarizing, and inserting the transformed data into the warehouse database. Refreshing: Periodically updating the warehouse with new data from the sources. 5. What is Metadata in the context of a Data Warehouse, and why is it crucial? Metadata is "data about data." It acts as a roadmap and directory for the data warehouse. It helps users and systems understand what data is available, where it came from, what it means, and how it has been transformed.

Lecture- 2 Structured Questions & Answers

1. What are the core components of a Data Warehouse architecture? A modern DWH architecture is multi-tiered and consists of several integrated components: Source Systems: The operational databases and external data sources that provide the raw data. Data Staging Area: The "workshop" where the ETL (Extract, Transform, Load) process occurs. Data is extracted from sources, cleaned, transformed, and integrated here. Data Storage: This includes the central Enterprise Data Warehouse and smaller, department- specific Data Marts. Information Delivery Component: The tools and applications that allow users to access and analyze the data (e.g., OLAP, reporting tools, data mining, dashboards). Metadata Component: The "data about data" that describes the warehouse's structure, source, and transformation rules. It is essential for building, maintaining, and using the DWH. Management and Control Component: Coordinates all activities, handling security, monitoring, data quality, backups, and storage management. 2. What is the ETL process, and why is it considered the most critical part of building a data warehouse? ETL stands for Extract, Transform, Load. It is the process of moving data from source systems into the data warehouse. Extract: Reading and copying data from various source systems (e.g., sales database, HR system). Transform: The crucial step of cleaning and restructuring the data. This includes: Cleaning: Correcting misspellings, standardizing values (e.g., "NY" to "New York"). Integrating: Combining data from different sources and resolving conflicts. Creating Surrogate Keys: Replacing operational system keys with warehouse-controlled keys to ensure consistency and handle historical changes. Load: Inserting the transformed data into the target data warehouse tables.

Why it's critical: The ETL process is complex and time-consuming, often taking more than 70% of the total project effort and risk. It is responsible for ensuring the data is relevant, high-quality, and trustworthy , which is the entire foundation for reliable business intelligence.

3. Differentiate between a Data Warehouse and a Data Mart. Property Data Warehouse Data Mart Scope Enterprise-wide Departmental (e.g., Sales, Marketing) Subjects Multiple, integrated subjects Single subject or specific business process Data Source Many heterogeneous sources Fewer sources, often the Data Warehouse itself Size Large (100 GB to > 1 TB) Smaller (typically < 100 GB) Implementation Time Long (months to years) Shorter (months) Example: An Enterprise Data Warehouse would contain integrated data about customers, products, sales, and HR. A Sales Data Mart would be a subset containing only the data relevant to the sales department, like sales figures, customer demographics, and product performance. 4. Compare and contrast the Top-Down (Inmon) and Bottom-Up (Kimball) approaches to building a Data Warehouse. Top-Down (Inmon): Process: Build a centralized, integrated Enterprise Data Warehouse first. Then, create departmental Data Marts as subsets from this central repository. Advantage: Provides a single, consistent "version of the truth" for the entire enterprise. Disadvantage: Takes longer and requires a larger initial investment before showing value.

Lecture- 3 Structured Questions & Answers

1. What is Dimensional Modeling, and what is its primary purpose in a Data Warehouse? Dimensional modeling is the process and outcome of designing logical database schemas to support OLAP and Data Warehousing solutions. Its primary purpose is to summarize and rearrange data, presenting views that support data analysis. It results in a design that is easy to understand, provides a standard framework for applications, and is optimized for query performance. 2. Define the three core concepts of a Dimensional Model: Dimension, Attribute, and Hierarchy. Dimension: A category of information used for analysis. Example: Time, Product, Customer. Attribute: A unique level within a dimension. Example: 'Month' is an attribute in the 'Time' dimension. Hierarchy: The specification of levels that represents the relationship between different attributes within a single dimension. Example: A hierarchy in the Time dimension is Year → Quarter → Month → Day. 3. What is the fundamental difference between a Fact Table and a Dimension Table? Fact Table: This is the primary table in the schema that stores quantitative, numerical performance measurements (measures) of the business. The data is numeric and additive (e.g., units_sold, dollars_sold). It contains foreign keys that link to dimension tables. Dimension Table: These tables contain descriptive, textual information (attributes) that provide context to the facts. Examples: product_description , customer_name , month_name_._ They contain the primary keys that are referenced by the fact table. 4. Compare and contrast the Star Schema and the Snowflake Schema. Star Schema: This is the simplest form. A single fact table sits in the middle and is connected directly to all its dimension tables. The dimension tables are denormalized (all attributes for a dimension are in one table).

Snowflake Schema: This is a refinement of the star schema where the dimensional hierarchies are normalized. This means a dimension table (e.g., Product) can be broken down into smaller tables (e.g., Product linked to Product_Category). It forms a shape similar to a snowflake. Contrast: The key difference is that Star uses denormalized dimensions for simplicity and query performance, while Snowflake uses normalized dimensions to reduce data redundancy.

5. What is a Fact Constellation (Galaxy Schema), and when is it used? A Fact Constellation is a dimensional model that consists of multiple fact tables that share dimension tables. It is like a collection of stars, hence the name "galaxy schema." It is used when you need to model multiple business processes (e.g., Sales and Shipping) that share common dimensions (e.g., Time, Product). The shared dimensions are called **"conformed dimensions."

  1. Why are Surrogate Keys used in dimension tables instead of the original business keys?** Surrogate keys are system-generated, unique integers used as the primary key in a dimension table for several reasons: Integrate Data from Different Sources: Different source systems may use different keys for the same entity. A surrogate key provides a single, consistent key in the warehouse. Handle Key Changes: If a business key changes in the source system, the historical data in the warehouse remains consistent because it uses the immutable surrogate key. Manage Slowly Changing Dimensions (SCD): They allow the same business entity (e.g., a salesperson) to have multiple records in the dimension table to track historical changes (e.g., when they move to a new region). 7. How does a Data Cube relate to the multidimensional model? A Data Warehouse is based on a multidimensional data model. A Data Cube (or Hypercube) is a way to visualize and store this multidimensional data internally. It allows users to easily analyze data by looking at the intersection of various dimensions (like Product, Region, Time). Users can "slice and dice" the data by choosing different attributes for rows, columns, and filters, and can view different measures (e.g., headcount, average salary) at these intersections.

4. Using the Hotel Serena example, what is the "grain" of the fact table likely to be, and what are the corresponding dimensions? Grain: The grain is most likely the daily status of a specific room type in a specific hotel. This is inferred from the facts (Occupied rooms, Vacant rooms) and the dimensions. Dimensions: Hotel, Room Type, Time. 5. How does an Information Package Diagram help in transitioning from an Entity- Relationship Diagram (ERD) to a Dimensional Model? The Information Package Diagram helps identify the core subject (business process) and its dimensions and facts. This clarity allows a designer to deconstruct a complex, normalized ERD (which contains many entities for a single business process) into a simplified, denormalized Dimensional Model. The ERD's many related tables (like Order, Order-Line, Store, Clerk) are transformed into a single fact table connected to clear dimension tables (Time, Store, Clerk, Product, etc.), as shown in the slides. The Information Package defines the "what" and "why," which guides the "how" of the dimensional design.

Lecture – 5 Structured Questions & Answers

1. What is the ETL process and why is it considered a critical part of a Data Warehouse? ETL stands for E xtraction, T ransformation, and L oading. It is the process of copying data from source systems (like OLTP databases), transforming it to match the data warehouse schema, and loading it into the data warehouse. It is critical because it is a complex, ongoing process that consumes a significant portion of development effort. It ensures that the data in the warehouse is integrated, clean, high-quality, and usable for analysis. 2. What is the purpose of a Staging Database in the ETL process? The ETL staging database is a separate relational database server. Its purpose is to create a logical and physical separation between the source systems and the data warehouse. This separation minimizes the performance impact of the intense, periodic ETL activities on both the operational source databases and the final data warehouse database used for querying. 3. Describe the "Data Discovery Phase" in extraction and explain one key challenge it addresses. The Data Discovery Phase is the initial step where the ETL team identifies and examines every source system, table, and attribute needed for the warehouse. A key challenge it addresses is identifying the "System of Record" —the original, authoritative source for a piece of data. This is crucial because data is often stored redundantly across an enterprise, leading to different versions of the same data. The System of Record ensures data consistency. 4. List and briefly describe two techniques for capturing changed data from source systems. Audit Columns: This technique uses columns appended to source tables (like last_modified_date) that are updated by the database or triggers whenever a record is added or changed. The ETL process uses these columns to identify new or modified records since the last extraction. Process of Elimination (Snapshot Differential): This technique involves taking a full snapshot of the source data and comparing it with the snapshot from the previous ETL run. The differences between the two snapshots (the "deltas") are identified and sent to the data warehouse. It is very reliable but can be inefficient for large datasets.