Create the times star schema dimension table via sql

Assignment Help PL-SQL Programming
Reference no: EM13780939

In this assignment you will be creating a data warehouse database for Online Vehicle Sales (OVS), Inc. The data warehouse is comprised of 4 dimension tables and a fact table based on the Project #2 Star Schema diagram posted in LEO's Week #6 area. Your OLTP database tables and star schema tables will reside in the same Oracle schema.

You can perform this assignment based on a database on Nova or any other Oracle system you wish, but you must use the Oracle RDBMS.
You should use one or more SQL script files to complete this assignment. Your script files should contain all your SQL and PL/SQL code. Do NOT submit your SQL script files. Doing so may result in confusion and will result in lost points.

Everything for this assignment must be in a single file. If you are using SQL*Plus you must put all your SQL, PL/SQL, and results together in a single SPOOL file. If you are using SQL Developer or other GUI, put all your screen snapshots in a single file for both your SQL statements and PL/SQL as they executed and the results. Failure to include all your SQL, PL/SQL, and all your Oracle execution results along with them will result in lost points.

Do NOT submit additional files as this only complicates the grading, and will result in lost points.

The specific assignment steps are listed below. In order to earn full credit you must keep your steps in the order shown, number your steps, and put everything in a single file.

Your FINANCING_PLANS table should already be created and populated. Your Plan_ID primary key is the Plan_Code column. Don't worry about changing this to Plan_Code or changing any other column names you already have.

1) Create the DEALERSHIPS star schema dimension table via SQL. Add at least 2 rows of data via INSERT statement(s). After populating your DEALERSHIPS table execute a "SELECT * FROM dealerships;" SQL statement to display the entire contents. Show all your SQL code for this step and the Oracle results from executing it.

2) Create the VEHICLES star schema dimension table via SQL. Change your existing OLTP VEHICLES table to OLTP_VEHICLES via the SQL RENAME command and change your SALES table's foreign key to reference this new table name. For the Vehicle_Code primary key column use an Oracle sequence to populate the values. For the Description column use all concatenated combinations of Make and Model of vehicles you have. Use a PL/SQL block to populate the Description column by SELECTing the combinations from your OLTP_VEHICLES table and then INSERTing the combinations into your new VEHICLES table, which would best be performed via a cursor in a loop. After populating your VEHICLES table execute a "SELECT * FROM vehicles ORDER BY vehicle_code" SQL statement to display the entire contents. Show all your SQL and PL/SQL code for this step and the Oracle results from executing it.

3) Create the TIMES star schema dimension table via SQL. This is "TIME" table in the star schema figure. The Sale_Day primary key column values should be all dates from your first sale date through and including your last sale date from your SALES table. The Day_Type values should be 'Weekday', 'Weekend', or 'Holiday' (this trumps Weekday and Weekend). Set all occurrences of the following days for your date range to be holidays: New Year's Day, Martin Luther King Jr's Birthday, President's Day, Memorial Day, 4th of July, Labor Day, Columbus Day, Veterans Day, Thanksgiving, and Christmas. Use a PL/SQL block to populate the TIMES table. After populating your TIMES table execute the SQL statement "SELECT day_type, COUNT(*),MIN(sale_day),MAX(sale_day) FROM time GROUP BY day_type ORDER BY day_type" to show the summarized contents of your table. Show all your SQL and PL/SQL code for this step and the results.

4) Create the SALES_FACTS star schema fact table via SQL. Ensure that you have declared foreign keys of Sale_Day, Vehicle_Code, Plan_Code, and Dealer_ID to reference your TIMES, VEHICLES, FINANCING_PLANS, and DEALERSHIPS tables, respectfully. Ensure that you have a primary key for the SALES_FACTS table that is a composite of the Sale_Day, Vehicle_Code, Plan_Code, and Dealer_ID columns. Do a DESC (i.e. DESCRIBE) of your SALES_FACTS table after it's created.

Reference no: EM13780939

Questions Cloud

Development stack for building commercial websites : Based on the Gariffo (2010) (Kercher (2011) article, how has Adobe leveraged its 2005 acquisition of Macromedia to expand its portfolio, which include development tools, such as the ColdFusion, Dreamweaver, Flash, and Flex technologies to provide ..
Individual visual logic – calculations : Individual Visual Logic - Calculations.Select two calculation tasks a program could perform that would be useful.
Distinct set of characteristics : The US social class system is typically described as having five individual classes. They are the Upper Class, Upper-Middle Class, Middle Class, Lower-Middle Class, and lower Class. Each social class has a distinct set of characteristics. Based on..
Questions about how the economy works : A circular flow diagram that includes the government sector. For this part of your paper, you should include a description of the roles that each participant plays in the economy and how the different sectors interact in the markets.
Create the times star schema dimension table via sql : Create the TIMES star schema dimension table via SQL. This is "TIME" table in the star schema figure. The Sale_Day primary key column values should be all dates from your first sale date through and including your last sale date from your SALES ..
Write reflective paragraphs about contemporary women issues : Write three short reflective paragraphs about Contemporary Women issues.
Explanation of how you think ethics impacts public policy : An explanation of how you think ethics impacts public policy. Be specific by explaining how ethics has impacted a specific example. Then, describe two or three ethical guidelines for decision-makers and policy analysts that you believe are the mos..
Provide an analysis on customer behavior : Perform a Join operation on the tables tbl Customers and tbl Orders and develop a query to generate a report on customer transaction data.
Media coverage of harm to children : As we learn in the video, Crimes of the Powerful, our justice system tends to focus on street crime, often ignoring much more significant problems such as white-collar, corporate, and state crime. The video also discusses euthanasia, although the ..

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  If the value for the listprice column is a negative number

If the value for the ListPrice column is a negative number, the stored procedure should raise an error that indicates that this column doesn't accept negative numbers. Similarly, the procedure should raise an error if the value for the DiscountPer..

  Select distinct cmdclient

SELECT DISTINCT CMDclient.'Client Code SCA' as GuestCode, CMDextras.ArrivalDate as arr, CMDextras.DepartureDate as dep, CMDapr.FirstName as fname, CMDapr.Surname as lname

  Create a clustered index on the groupid column

Write the CREATE INDEX statements to create a clustered index on the GroupID column and a nonclustered index on the IndividuallD column of the GroupMembership table.

  A critical analysis of the available literature

Given the time scale and the need to obtain ethical approval for primary research, you are required to undertake secondary research only i.e. research using data from other sources.

  Database analysis and design

Implement the initial database design for the Customer Relationship Management VIEW as described below in your selected RDBMS. You need to create the Entity-Relationship model from your normalization and Database analysis, define tables, primary k..

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

  Calculate days between ordering and shipping

Calculate the Tax on an Order, Calculate the Total Shopper Spending - Develop a SELECT statement using the BB_SHOPPER table to produce a list of each shopper in the database and his or her respective totals.

  Describe the meaning of keyword exists and not exists

Describe the meaning of the keyword EXISTS. Describe how any and all relate to EXISTS and NOT EXISTS. Write a query which will display names of any customers who are interested in all artists.

  Perform the subsequent queries on the array

Use LINQ to select the PartDescription and Quantity and sort the results by Quantity - Use LINQ to select from each Invoice the PartDescription and the value of the Invoice.

  Shows the shipping and billing addresses

Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database.

  Write a select statement that returns these column names

Write a SELECT statement that returns these column names and data from the Products table:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd