Question: help me to this steps with SQL language code of tables in prevoius lab: create table T_SALESMAN (SALES_REP_ID, SNAME) as select nvl(SALES_REP_ID,999) , 'Name-' ||SALES_REP_ID

 help me to this steps with SQL language code of tables
in prevoius lab: create table T_SALESMAN (SALES_REP_ID, SNAME) as select nvl(SALES_REP_ID,999) ,
'Name-' ||SALES_REP_ID from OE.ORDERS; ..... create table D_customers (ID_C ,C_FNAME,C_LNAME,Gender,Type) as select
help me to this steps with SQL language
code of tables in prevoius lab:
create table T_SALESMAN
(SALES_REP_ID, SNAME)
as
select nvl(SALES_REP_ID,999) , 'Name-' ||SALES_REP_ID
from OE.ORDERS;
.....
create table D_customers (ID_C ,C_FNAME,C_LNAME,Gender,Type)
as
select customer_id,cust_first_name,cust_last_name,gender,MARITAL_STATUS from customers_copy;
.....
create table D_orders (ID_O,Omode,status)
as
select order_id,order_mode,order_status from orders_copy;
......
create table D_salesman(id_s,sname)
as
select distinct sales_rep_id ,sname from T_SALESMAN;
.....
create table D_time (id_t ,d_date,month_no , month_name ,quarter,d_year)
as
select id_date ,order_date,month_no ,month_name,quarter ,yyear from T_DATE;
.....
alter table d_orders
add constraint PK_D_ORDERS primary key(id_o);
alter table d_salesman
add constraint PK_D_SALEMAN primary key(id_s);
alter table d_time
add constraint PK_D_TIME primary key(id_t);
alter table D_CUSTOMERS
add constraint PK_D_CUSTOMERS primary key(id_c);
customer_id,cust_first_name,cust_last_name,gender,MARITAL_STATUS from customers_copy; ..... create table D_orders (ID_O,Omode,status) as select order_id,order_mode,order_status from
There is a script for download, but I cannot add it in the cheeg

Tables to use In the previous Lab you have created the tables D_ORDERS, D_CUSTOMERS, D_TIME, and D_SALESMAN. To complete the loading of the Star schema depicted in Figure 8.1, you will need these dimension tables and the table ORDERS_COPY. Year SName ID_S D_SALESMAN Month-Name Quarter Month No Date IDT D_TIME OMode ORDERS D_ORDERS ID 0 Status ORDER AMOUNT FName ID SLName D_CUSTOMERS Gender Type Figure 8.2. A Simplified Star Schema Questions to Answer 1. CREATE the fact table F_ORDERS (FORDERS ID ORDER_AMOUNT....Complete with the other columns....). CCDS-221 Data Warehouse 2. The PK of the fact table F_ORDERS could be either the concatenation of all FKs referencing the dimensions linked to the fact, or the UNIQUE column F_ORDERS_ID. Define a PK constraint called PK_F_ORDERS_ID on the column F_ORDERS_ID. 3. The fact table F_ORDERS references the four dimensions D_TIME, D_CUSTOMERS, D_ORDERS and D_SALESMAN. Define all its Foreign keys (Follow the naming convention: FK_ORDERS_TO_DATE, 4. Create an Oracle Sequence SEQ_F_ORDERS starting with 1. (You will use this sequence to populate FORDERS ID primary key). 5. Develop SQL statement(s) to load F_ORDERS. Note that the measure ORDER_AMOUNT is in EURO and you extract it from the table ORDERS_COPY. 6. Display the SUM of the column ORDER_AMOUNT from the fact F_ORDERS. 7. Display the Turnover (sum of ORDER_AMOUNT) by Customer (ID_C, C_FName) and by Year. 8. COUNT the number of ORDERS having an amount greater that a given value (choose a value). 9. Display the percentage of amount of DIRECT Orders and ONLINE Orders. Measures Granularity. Suppose that we need to implement another star schema by removing the D_SALESMAN dimension from Figure 8.1. In this case, the granularity of the ORDER_AMOUNT measure changes since it functionally depends on 3 identifiers of dimensions instead of 4. 10. Referring to the content of the fact F_ORDERS, how many rows will be in the new fact? 11. Develop a SELECT statement that calculates and displays the rows of the new fact. T_SALESMAN SName Year Quarter Month-Name Month-No Date IDT D_TIME ID_ D_SALESMAN ORDERS_COPY OMode T_DATE FORDERS D_ORDERS ORDER_AMOUNT Status C FName ID C C LName D_CUSTOMERS CUSTOMER_COPY Gender o Type Tables to use In the previous Lab you have created the tables D_ORDERS, D_CUSTOMERS, D_TIME, and D_SALESMAN. To complete the loading of the Star schema depicted in Figure 8.1, you will need these dimension tables and the table ORDERS_COPY. Year SName ID_S D_SALESMAN Month-Name Quarter Month No Date IDT D_TIME OMode ORDERS D_ORDERS ID 0 Status ORDER AMOUNT FName ID SLName D_CUSTOMERS Gender Type Figure 8.2. A Simplified Star Schema Questions to Answer 1. CREATE the fact table F_ORDERS (FORDERS ID ORDER_AMOUNT....Complete with the other columns....). CCDS-221 Data Warehouse 2. The PK of the fact table F_ORDERS could be either the concatenation of all FKs referencing the dimensions linked to the fact, or the UNIQUE column F_ORDERS_ID. Define a PK constraint called PK_F_ORDERS_ID on the column F_ORDERS_ID. 3. The fact table F_ORDERS references the four dimensions D_TIME, D_CUSTOMERS, D_ORDERS and D_SALESMAN. Define all its Foreign keys (Follow the naming convention: FK_ORDERS_TO_DATE, 4. Create an Oracle Sequence SEQ_F_ORDERS starting with 1. (You will use this sequence to populate FORDERS ID primary key). 5. Develop SQL statement(s) to load F_ORDERS. Note that the measure ORDER_AMOUNT is in EURO and you extract it from the table ORDERS_COPY. 6. Display the SUM of the column ORDER_AMOUNT from the fact F_ORDERS. 7. Display the Turnover (sum of ORDER_AMOUNT) by Customer (ID_C, C_FName) and by Year. 8. COUNT the number of ORDERS having an amount greater that a given value (choose a value). 9. Display the percentage of amount of DIRECT Orders and ONLINE Orders. Measures Granularity. Suppose that we need to implement another star schema by removing the D_SALESMAN dimension from Figure 8.1. In this case, the granularity of the ORDER_AMOUNT measure changes since it functionally depends on 3 identifiers of dimensions instead of 4. 10. Referring to the content of the fact F_ORDERS, how many rows will be in the new fact? 11. Develop a SELECT statement that calculates and displays the rows of the new fact. T_SALESMAN SName Year Quarter Month-Name Month-No Date IDT D_TIME ID_ D_SALESMAN ORDERS_COPY OMode T_DATE FORDERS D_ORDERS ORDER_AMOUNT Status C FName ID C C LName D_CUSTOMERS CUSTOMER_COPY Gender o Type

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!