Develop pl-sql anonymous block that displays the total sales

Assignment Help PL-SQL Programming
Reference no: EM131955324

Project Assignent

In this assignment you will be performing some additional queries against your Online Vehicle Sales (OVS), Inc. online transaction processing (OLTP) database and also creating some simple anonymous PL/SQL blocks.

You will also begin the creation of a data warehouse database for Online Vehicle Sales (OVS), Inc. The full data warehouse is comprised of 4 dimension tables and a fact table based on the 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.

This assignment is based on the fully populated tables from Homework #2 so it assumes you've completed all work for that assignment.

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 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.

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

1) Execute SELECT COUNT(*) FROM <table_name>; statements for all 6 of your OVS, Inc. OLTP tables. You should have at least the following counts: CUSTOMERS table - 100 rows, VEHICLES table - 50 rows, SALESPERSONS table - 10 rows, FINANCING_PLANS - 5 rows, SALES table - 200 rows, and SALES_FINANCINGS table - 200 rows.

2) Via a single SELECT query display the zip code, make, and count with the largest total car purchases for a zip code and make combination (there may be a tie with two or more). Show the SQL statement you used and the results returned by Oracle from executing your SQL statement right after the statement.

3) Develop a PL/SQL anonymous block that displays the total sales for a zip code for a specific zip code. You may use any of your zip codes you wish. Show the PL/SQL statements in your block, the actual execution of your block, and the results returned.

4) Develop a PL/SQL anonymous block that displays the zip code with the largest total car purchases. Since there can be a tie with two or more zip codes, ensure that the lowest numeric zip code is displayed. The zip code displayed should correlate to the results of Step #2. Show the PL/SQL statements in your block, the actual execution of your block, and the results returned.

5) This step begins the creation of your data warehouse. Ensure that your FINANCING_PLANS table has already been created and populated via a "SELECT * FROM financing_plans;" SQL query. This table is used by both your OLTP database and serves as a dimension table in the star schema of your data warehouse database. 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. Show the SQL you used and executed and the results.

6) 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.

7) 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.

Reference no: EM131955324

Questions Cloud

Execute dijkstra shortest-path algorithm : Execute Dijkstra's shortest-path algorithm by hand on this graph, showing how the data structures evolve, with A as the starting vertex.
Identify the expected returns using yahoo finance : Identify the expected returns using Yahoo Finance. Look at current stock price, expected stock price in one year and the annual dividend.
Find articles about management control processes : Please use the APA format and find two journal (peer-reviewed) articles about management control processes. Please be sure that you have at least 3 in text.
Develop linear representation of timing of cash flows : Develop a timeline (linear representation of the timing of cash flows). Identify time value of money variable (PV, FV, PMT, N or I/YR) that needs to be solved
Develop pl-sql anonymous block that displays the total sales : Develop a PL/SQL anonymous block that displays the total sales for a zip code for a specific zip code. You may use any of your zip codes you wish.
How the different components of critical thinking will help : Explain how the different components of critical thinking will help you improve your writing and decision making.
Alternating characters in the two strings : Write function, named foldStrings(string1, string2) that takes, as arguments, two strings. If the two strings are equal in length, the function returns a string
Write a short paragraph about how you plan on objective : write a short paragraph about how you plan on your objective and measuring your success - This should be a broad statement about the objective of the investment
What inference can you draw from the numbers collected : Using only gov Websites report the current GDP, the current Federal deficit, the current Federal debt, and the bottom line of the current budget.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write sql statement to create user defined function

Write SQL statement which creates user defined function which returns int value. This int return value is obtained by deducting the lowest Count field value from the highest Count field value of Part table.

  Write an sql statement to display breed and type of all pets

Write an SQL statement to display the breed and type of all pets. Save as AllBreeds. Write an SQL statement to display the breed, and DOB of all pets having the type Cat. Save as Cats.

  Write an sql statement to produce a single column called

write an sql statement to produce a single column called itemlocation that combines the skudescriptionthe phrase is

  Build cross-cultural awareness

Working across cultures can be enriching and meaningful. Colleagues can build cross-cultural awareness by engaging with people who are similar to and yet different from them. At the same time, working across cultures also has its challenges.

  Develop and run a create function statement

Create a procedure named DDPAY_SP that identities whether a donor currently has an active pledge with monthly payments. A donor ID is the input to the procedure

  Installation of sql

Describe your experiences related to your setup of MySQL. Include any difficulties or issues that you had encountered during the installation.

  Write a compete pl/sql program to display the staffno

Write a compete PL/SQL program to display the StaffNo,

  Submit the design using mysql workbench or oracle modeler

You are dispatched as a consultant for XYZ Company to create a database for their applications. Since this is just an initial analysis, they just want you to create a conceptual design of the database. Submit the design using MySQL Workbench or Oracl..

  Write a select statement that joins the customers table

Write a SELECT statement that joins the Customers table to the Addresses table and returns these columns: FirstName, LastName, Line1, City, State, ZipCode.

  Major concern in enterprise application

Security and Privacy is a major concern in Enterprise Application. Write a short essay citing references, showing the roles of security and privacy and security in an enterprise Architecture program.

  Write sql statements for the ten queries

Write SQL statements for the ten queries - find the names of all Tracks that are more than 10 minutes (600,000 ms) long. Result: (name: varchar(255))

  Write an update statement that updates the customeraddresses

Write an UPDATE statement that updates the CustomerAddresses view you created in exercise 1 so it sets the first line of the shipping address.

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