Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL To calculate the Turnover and the Type of customers, follow the data preparation steps below: 1. CREATE a table CUSTOMER_COPY by copying the CUSTOMER

image text in transcribed

SQL

To calculate the Turnover and the Type of customers, follow the data preparation steps below: 1. CREATE a table CUSTOMER_COPY by copying the CUSTOMER table. 2. Add a column TUROVER NUMBER (12, 2) to the CUSTOMER_COPY table. 3. Write SQL correlated statements to populate the TUROVER column. 4. Display the entire content of the CUSTOMER_COPY table. 5. Add the column CUST_TYPE CHAR (1) to the CUSTOMER_COPY table. To populate the column CUST_TYPE with the appropriate TYPE, follow the steps below: 6. Implement a PL/SQL block using the IF and UPDATE statements to set the CUST_TYPE column value to 'A', 'B' or 'C' according to the rule explained above. 7. Display the whole content of the CUSTOMER_COPY table. 8. Display the number of customers, write it here......... 9. Count the number of Customers by CUST_TYPE, write it below: A B 10. Check manually the number of customers is the total of customers of all types. Save your session as Lab4.sql, download and clean the script file. Congratulations, you have prepared derived data you will use to load DW tables. To calculate the Turnover and the Type of customers, follow the data preparation steps below: 1. CREATE a table CUSTOMER_COPY by copying the CUSTOMER table. 2. Add a column TUROVER NUMBER (12, 2) to the CUSTOMER_COPY table. 3. Write SQL correlated statements to populate the TUROVER column. 4. Display the entire content of the CUSTOMER_COPY table. 5. Add the column CUST_TYPE CHAR (1) to the CUSTOMER_COPY table. To populate the column CUST_TYPE with the appropriate TYPE, follow the steps below: 6. Implement a PL/SQL block using the IF and UPDATE statements to set the CUST_TYPE column value to 'A', 'B' or 'C' according to the rule explained above. 7. Display the whole content of the CUSTOMER_COPY table. 8. Display the number of customers, write it here......... 9. Count the number of Customers by CUST_TYPE, write it below: A B 10. Check manually the number of customers is the total of customers of all types. Save your session as Lab4.sql, download and clean the script file. Congratulations, you have prepared derived data you will use to load DW tables

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_2

Step: 3

blur-text-image_3

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

How is health psychology a union between medicine and psychology?

Answered: 1 week ago

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago