Download Quiz 3 - Suraj @ LUMS

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Registry of World Record Size Shells wikipedia , lookup

Clusterpoint wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Relational algebra wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Concurrency control wikipedia , lookup

Serializability wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Object-relational impedance mismatch wikipedia , lookup

Database model wikipedia , lookup

Relational model wikipedia , lookup

Transcript
ROLL NO.
NAME
CS 543 – Data Warehousing
Quiz 3 Solution
(Time limit: 10 minutes)
1. (8 points) Consider the following relational schema (answer on the back-side):
cust_id, cust_name, street, city, state
1
|
m
transaction_id, amount
m
|
1
product_id, product_name, product_category
a. (1 point) Is the schema in 3NF (TRUE)
b. (2 points) Denormalize the schema for efficient query processing. Show all
attributes including primary and foreign keys and relationships (if any).
Depending on the types of queries, the database schema can be denormalized by joining
customer table with transaction table, or product table with transaction table, or all three
tables.
We will join all tables to form one denormalized table.
transaction_id, cust_id, cust_name, street, city, state, product_id, product_name,
product_category, amount
transaction_id is the primary key. There are no foreign keys.
c. (1 point) Give a query that would run faster on the denormalized schema.
Any query that involves several products and/or customers.
What is the total amount of products sold to customer XYZ?
What is the total amount of product category XYZ sold?
How did state ABC compare with state XYZ in product category K?
d. (4 points) Estimate the size of the database before and after denormalization.
Assume there are 100 K customers, 500 K products, and 2 M transactions. Each
customer, transaction, and product table record is 100 bytes long. Take the size of
the IDs attributes as 8 bytes.
Database size before denormalization
Customer table size = 100 * 100 = 10,000 Kbytes
Product table size = 500 * 100 = 50,000 Kbytes
CS 543 (Sp 04/05) – Dr. Asim Karim
Page 1 of 2
Transaction table size = 2 * 100 = 200 Mbytes
Total = 260 MB
Database size after denormalization
There will be one huge table, obtained by merging the customer and product tables into
the transaction table.
Size = 2 * (3 * 100 – 2 * 8) = 568 Mbytes
= about 753 MB
(Deduct one point for those who did not take into account the duplication of cust_id and
product_id after joining)
2. (2 points) List at least two benefits of the dimensional modeling approach for DW
design.




it is intuitive and based on a business perspective of the organization
it is easy to understand by business executive (non-technical people)
it is found to be efficient for the types of queries presented to the DW
CS 536 (Au 03/04) – Dr. Asim Karim
Page 2 of 2