0% found this document useful (0 votes)
41 views5 pages

DWH Lab-2

The document outlines the design of star schemas for various data warehouses, including those for healthcare, education, sports, and a wholesale furniture company. It specifies the identification of fact and dimension tables, as well as their primary and foreign keys, and measures for each scenario. Additionally, it addresses the conversion of 3NF to dimensional modeling for data warehouses.
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)
41 views5 pages

DWH Lab-2

The document outlines the design of star schemas for various data warehouses, including those for healthcare, education, sports, and a wholesale furniture company. It specifies the identification of fact and dimension tables, as well as their primary and foreign keys, and measures for each scenario. Additionally, it addresses the conversion of 3NF to dimensional modeling for data warehouses.
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

1.

Suppose that a data warehouse consists of the three dimensions time,


doctor, and patient, and the two measures count and charge, where
charge is the fee that a doctor charges a patient for a visit.
• Design a star schema for such a data warehouse.
• Identifying the fact table(s) and dimension table(s).
• Identifying their primary key(s), foreign key(s) and measures.

2. Suppose that a data warehouse for Big-University consists of the


following four dimensions: student, course, semester, and instructor, and
two measures count and avg. grade. When at the lowest conceptual level
(e.g., for a given student, course, semester, and instructor combination),
the avg grade measure stores the actual course grade of the student. At
higher conceptual levels, avg grade stores the average grade for the given
combination.
• Design a Star Schema schema for such a data warehouse.
• Identifying the fact table(s) and dimension table(s).
• Identifying their primary key(s), foreign key(s) and measures.

3. Suppose that a data warehouse consists of the four dimensions, date,


spectator, location, and game, and the two measures, count and charge,
where charge is the fare that a spectator pays when watching a game on a
given date. Spectators may be students, adults, or seniors, with each
category having its own charge rate.
• Design a star schema for such a data warehouse.
• Identifying the fact table(s) and dimension table(s).
• Identifying their primary key(s), foreign key(s) and measures.
4. Design the data warehouse for a wholesale furniture company.
The data warehouse has to allow to analyze the company’s situation at
least with respect to the Furniture, Customers and Time. Moreover, the
company needs to analyze:
the furniture with respect to its type (chair, table, wardrobe, cabinet. . . ),
category (kitchen, living room, bedroom, bathroom, office. . . )
and material (wood, marble. . . )
the customers with respect to their spatial location, by considering at
least cities, regions and states
The company is interested in learning at least the quantity, income and
discount of its sales

• Design a star schema for such a data warehouse.


• Identifying the fact table(s) and dimension table(s).
• Identifying their primary key(s), foreign key(s) and measures.
5. Convert 3NF to Dimensional modeling
• Design a star or snowflake schema for such a data warehouse.
• Identifying the fact table(s) and dimension table(s).
• Identifying their primary key(s), foreign key(s) and measures.
6. Convert 3NF to Dimensional modeling
7. Convert 3NF to Dimensional modeling
• Design a star or snowflake schema for such a data warehouse.
• Identifying the fact table(s) and dimension table(s).
• Identifying their primary key(s), foreign key(s) and measures.

Common questions

Powered by AI

A star schema improves query performance in a data warehouse for Big-University by denormalizing data, which significantly reduces the amount of join operations needed during query execution. This leads to faster query performance because data related to courses, students, instructors, and semesters are consolidated in dimension tables directly linked to the central fact table (e.g., 'GradeFacts'). In contrast, a typically normalized database would scatter data across numerous tables based on third normal form, requiring more complex joins and making analytical queries slower. The simplified structure of star schemas also makes queries more straightforward to write and understand .

To design a star schema for a data warehouse with time, doctor, and patient as dimensions and count and charge as measures, the fact table could be named 'VisitFacts'. This table would include the primary key as a composite key of foreign keys referencing the dimension tables. The dimension tables could be 'Time', 'Doctor', and 'Patient', each containing a primary key that uniquely identifies its records. The 'VisitFacts' table would store the count and charge measures for each combination of time, doctor, and patient. For instance, 'VisitFacts' would have columns like TimeID, DoctorID, PatientID as foreign keys and Charge as a measure column, where Charge is the fee for the doctor's visit .

Designing a star schema for a university data warehouse involves accommodating academic-specific dimensions such as student, course, semester, and instructor, with measures like count and avg grade. Each dimension would have its own table, e.g., 'StudentDim', 'CourseDim', etc., and a 'CourseFacts' table as the fact table with a composite key from the dimensions. For a wholesale furniture company, the dimensions focus on business-oriented attributes like furniture, customers, and time with measures such as quantity, income, and discount. The dimension tables might be 'FurnitureDim', 'CustomerDim', etc., with a 'SalesFacts' fact table. The university schema focuses on educational datasets while the furniture company's schema prioritizes sales data analysis .

Measures in the fact table of a star schema serve as the quantitative data items that are analyzed. They typically include numeric values like count, sales, charge, or average grade. When defining measures, it's crucial to assess their aggregability—how they can be meaningfully aggregated at different hierarchical levels of dimensions. For instance, 'Charge' can be summed up across different time periods, while 'AvgGrade' might require weighted aggregation methods to ensure accurate representation. It's also important to ensure measures align with business objectives and provide actionable insights. Defining granularity is critical, determining the level of detail captured within the fact table, which directly influences how data can be queried and analyzed .

To accommodate scalable analytics, star schema design principles should focus on using surrogate keys for primary and foreign keys to allow seamless integration and maintenance. This approach accommodates the insertion of new records without disruption. Denormalizing tables while maintaining critical relationships optimizes for fast read access while supporting complex analytical queries with minimal performance degradation. In the context of a university, indexing fields such as 'CourseID' or 'StudentID' can accelerate query performance on large datasets. For a furniture company, ensuring dimension tables—like 'FurnitureDim'—can be easily expanded with attributes such as 'Material' or new category types facilitates scalability as the business and data requirements grow .

When identifying primary and foreign keys in a data warehouse schema design, considerations include ensuring the primary key uniquely identifies each row in the dimension tables, as it becomes the reference point for foreign keys in the fact table. Primary keys should be simple and as small as possible to optimize query performance. Foreign keys in fact tables should point to these primary keys to maintain referential integrity between the fact and dimension tables. Additionally, the design should consider future expansion, ensuring keys can support scalability without requiring significant restructuring. For instance, surrogate keys are often employed for consistent, system-generated identifiers .

Converting 3NF to a dimensional model involves several transformation steps: 1) Identifying the core business processes to model and the measures to associate. 2) Collapsing related entities to form dimension tables; entities that are separated in 3NF can be combined if they influence the same categories. 3) Creating a fact table that connects to all dimension tables, primarily using surrogate keys for easier management. 4) In a star schema, denormalizing dimension tables to contain complete attribute sets helps reduce complexity and speed up query performance. Alternatively, a snowflake schema maintains some normalization within the dimension tables to avoid redundancy while retaining the dimension linkages via foreign keys. These transformations simplify data relationships, focusing on analysis rather than transactional efficiency .

Converting a database from 3NF to a dimensional model primarily involves denormalizing data to reduce the number of joins needed to query the database, which enhances performance for read-heavy operations typical in data warehousing. In 3NF, data is compartmentalized across many related tables to reduce redundancy, which is optimal for transactional systems. In a dimensional model, however, related data is often brought together in star or snowflake schemas—structures that include a centralized fact table surrounded by dimension tables. This shift simplifies queries and improves the speed of generating insights from large datasets, making it ideal for analytical processing .

In a star schema for a furniture company, the primary components are the fact table and dimension tables. The fact table, potentially named 'SalesFacts', records transactional data such as sales quantity, income, and discount. Dimension tables, like 'FurnitureDim', 'CustomerDim', and 'TimeDim', provide descriptive information relevant to the transactions. Each transaction in the 'SalesFacts' table maps to entries in the dimension tables through foreign keys that reference the primary keys of dimension tables. For example, the 'FurnitureDim' might capture attributes such as type, category, and material, while the 'CustomerDim' looks at spatial locations (cities, regions, states).

A snowflake schema is preferred over a star schema in certain contexts due to its normalized structure, which reduces redundancy and enhances data integrity. Each dimension in a snowflake schema can have related tables that store more detailed attributes in third normal form, unlike the denormalized nature of star schemas. This design is beneficial when accurate maintenance of detailed relationships and attributes is crucial, or when dimension tables are significantly large, thus improving the efficiency of update operations by avoiding redundancy. However, snowflake schemas can complicate queries due to more tables and joins, making them less performant compared to star schemas in read-heavy operations .

You might also like