Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL stetamnts just Q4 and Q6 please screenshot the code Answer the following questions. Part I. Denormalization Consult tables PRODUCT_INFORMATION and CATEGORY_TAB to understand their

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
SQL stetamnts
just Q4 and Q6
please screenshot the code
Answer the following questions. Part I. Denormalization Consult tables PRODUCT_INFORMATION and CATEGORY_TAB to understand their structure and content. CATEGORIES_TAB (CATEGORY_NAME, CATEGORY_DESCRIPTION, CATEGORY_ID, PARENT_CATEGORY_ID) PRODUCT_INFORMATION (PRODUCT_ID, PRODUCT_NAME... CATEGORY_ID ..., SUPPLIER_ID..) Note the existence of two relationships: each product has a CATEGORY_ID that exists in the CATEGORY_TAB table, and - each category has a parent category (PARENT_CATEGORY_ID). 6 Page 1. CREATE the following tables: PRODUCT_COPY (PRODUCT_ID, PRODUCT_NAME, CATEGORY_ID, SUPPLIER_ID) by SELECTing rows from the OE.PRODUCT_INFORMATION table. CATEGORY_COPY by SELECTing rows from the OE.CATEGORY_TAB table. 2. Use the CREATE and SELECT statements to create a Denormalized table called T_PRODUCT by natural-joining PRODUCT_COPY and CATEGORY_COPY. T_PRODUCT has the columns: PRODUCT_ID, PRODUCT_NAME, CATEGORY_ID, CATEGORY_NAME, PARENT_CATEGORY_ID, PARENT_CATEGORY_NAME, SUPPLIER_ID Display the entire content of the T_PRODUCT table. (You should get as many rows as in the PRODUCT_COPY table). In which Normal form is T_PRODUCT? Justify your answer. Note that you have prepared the denormalized table T_PRODUCT to load a DW PRODUCT dimension. 3. Using the Multidimensional model concepts/Terminology, what are the Analysis-level columns and the Weak-attributes in T_PRODUCT? Part II. Split table 4. Use the CREATE and SELECT statements to split the OE.ORDERS table into two sub-tables you call: A. ORDERS_DIRECT (ORDER_ID, ORDER_YEAR, ORDER_MODE, SALES_REP_ID) containing rows such as ORDER_MODE = 'DIRECT' and having NOT NULL SALES_REP_ID (Use TO_CHAR, TO_NUMBER functions) a. Display the table content. You should get 70 rows. b. Check that the ORDER_MODE values are correct regarding the condition in the 'query- Where'. C. Remove the ORDER_MODE column from ORDERS_DIRECT. B. ORDERS_ONLINE (Same columns as ORDERS_DIRECT) containing rows such as ORDER_MODE = ONLINE a. Display the table content. You should get 32 rows. b. Check that the ORDER_MODE values are correct regarding the condition in the 'query- Where' 7 IP CCDS-221 Data Warehouse c. Remove the ORDER_MODE and SALES_REP_ID columns from ORDERS_ONLINE Optional question. 5. In the same way, split the CUSTOMERS table into two tables having the same structure as CUSTOMERS, one table for Male customers (GENDER = 'M') and one for Females (GENDER = "F"). Part III. Merge tables Merge is the opposite of Split. It uses the UNION operator. The tables to merge must be compatible, i.e. have the same number of columns with compatible data types respectively. 6. Create two compatible tables issued from the tables in the DB you are using and merge their contents. congratulations, you have practiced your skills and acquired practices in ETL. You can now go further in this ETL process (next labs)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

ISBN: 3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

What can the subject speech to?

Answered: 1 week ago

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago