Develop a pl/sql user-defined function

Assignment Help PL-SQL Programming
Reference no: EM13780885

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 two simple PL/SQL user-defined functions and a simple PL/SQL stored procedure.

This assignment is based on the fully populated tables from Project #1 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 ; 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 sale ID and plan ID of all sales in the last 30 days, sorted by sale ID. Show the SQL statement you used and the results returned by Oracle from executing your SQL statement right after the statement.

3) Via a single SELECT query display the zip code, make, and count with the largest total car purchases (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.

4) Develop a PL/SQL user-defined function ZIP_CODE_SALES that returns the total sales for a zip code when the zip code is supplied as an input parameter. You may use any of your zip codes you wish. Show the PL/SQL statements in your function, the execution of your function, and the results returned.

5) Develop a PL/SQL user-defined function ZIP_CODE_SALES_WINNER that returns 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 returned. Your returned value should match the results of Step #3 above. Show the PL/SQL statements in your function, the execution of your function, and the results returned.

6) Develop a PL/SQL stored procedure ZIP_CODE_MAKE_SALES_WINNER that returns the zip code and make with the largest total car purchases. Since there can be a tie with two or more zip codes and makes, ensure that the lowest combined numeric zip code and character make combination is returned. Your returned value should match the results of Step #3 above. Show the PL/SQL statements in your stored procedure, the execution of your stored procedure, and the results returned.

9700762_1420_script_hw2.txt

9700762_2cmis420_project1_spool_0.txt

9700777_3homework3spool_3_0.txt

9700717_1project_1sql_script_2_1.txt

Reference no: EM13780885

Questions Cloud

Provide a bulleted plan of action for solutions you suggest : Provide a bulleted plan of action for the solutions you suggest. Finally discuss the best solutions in your estimation.
Assignment on global operations management : Global Operations Management Assignment.As part of the management team for PPQ Parts manufacturing company.
Evaluation of each carriers overarching business strategy : Conclude with an evaluation of each carriers overarching business strategy. Explain your assessment of the most profitable strategy - Upon reading the paper, a potential passenger should have the information needed to choose between the two airli..
Respond to the given post : There are steps that should be taken that can produce results with minimum errors. These steps, known as the intelligence cycle, include planning, collection, processing, analysis, and dissemination
Develop a pl/sql user-defined function : Develop a PL/SQL user-defined function ZIP_CODE_SALES_WINNER that returns 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 returned.
Find the fourier transform of f(t) : Find the Fourier Transform of f(t),Plot (with axis labels) the frequency spectrum for the continuous signal.  (both magnitude and phase)What is the bandwidth of this signal in rad/s and Hz?
Ethical issues related to documenting : What specific legal issues can arise in documenting assessment, testing, and diagnosis?
Compare and contrast the management information systems : Achieve work with MIS to develop and recommend workable solutions to specific business problems
Ethical alternatives for resolving this dilemma : How might Irina's age and parents' involvement in the referral affect how Dr. Matthews can resolve the dilemma? How might the state law on treatment of minors and HIPAA rule on access of guardians to a minor's health care record influence Dr. Matt..

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Design database for school students

Design a database to maintain information about school staff and students satisfying following properties: 1. Staff will be having their id, name and classes they are teaching 2. Student will be having name, roll no,..

  Write a select statement that returns three columns

Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns.

  Create qrycustomersm that selects all customers

Write the SQL below that would display all Customers whose first name begins with the letter J. Your query should display the FirstName, LastName, Phone, and MembershipStatus fields from the tblMember table.

  Model layer takes advantage of a sql server database

Creation of a Model Layer that takes advantage of a SQL Server Database with at least new two tables conforming to the Entity Framework or a NoSQL solution using MongoDb. Creation of a ViewModel layer that supports your Views and and a repository l..

  Submit the table creation statements for the database model

submit the table creation statements for the database model. submit them all in a single script file.also submit a

  The cast function to return the date added column

A column that uses the CAST function to return the DateAdded column with its full time only (hour, minutes, seconds, and milliseconds)

  Prepare a sql statement to use joining the tables

Write a SELECT statement that joins the Customers, Orders, OrderItems, and Products tables.

  Execute the ddl in sql developer to create the database

Execute the DDL in SQL Developer to create the database. Populate the tables with data taken from the invoices

  Question 1 calculate the tax on an ordercomplete the

question 1. calculate the tax on an ordercomplete the following steps to create a procedure to calculate the tax on an

  Draw an entity-relationship diagram

Draw an Entity-Relationship Diagram (ERD) for the data storage requirements of a business described in the case study and Data Model Transformation.

  Using the oracle developer data modeler tool

Credit will be given to queries that are not trivial, for example, "SELECT * FROM Tablename" is unlikely to gain more than one mark. SQL Developer can be used to produce the queries and populate the tables.

  Find the sum of the elements of a

A is an ArrayList of size N. The elements of A are integers, they are in sorted order increasing from the low end of the array, and no two integers are the same. Variable x is an integer. Which of the following operations takes time that is less t..

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