Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PL-SQL Expert

Purpose:

This laboratory provides practice in the use of SQL commands to create simple reports in an Oracle database.

Procedure:

Using your assigned user name, password, and host string, log in to Oracle SQL*Plus. Collect yourdialog. Be sure to include each of the following SQL scripts in your report. Follow the instructor's instruction concerning any additional required items, any needed sign-offs, and the due date of this report.

Use SQL to create the following reports.

1. In order to fit the output on the page setline size to 100 and the page size to 50. Generatea script file named customer_report.sql that displays the name, street, city, state, and zip code for each customer. Concatenate the city, state and zip code for each customer into a single expression. Insert a comma between the city and state data. Execute this script file.

2. Copy the customer_report.sql file to the customer_report2.sql file. Create a view within this customer_report2.sqlscript file. This view named customer_reportshould display the attributes displayed in item #1 above. The columns names should be CUST_NAME, CUST_STREET_ADDRESS, and CUST_CITY_STATE_ZIP. This script should display the contents of this view. Execute this script file to create and display this view.

3. Developthecustomer_report_format.sqlscript file that removes old headings and creates the column headings in the customer_reportview to CUSTOMER NAME, CUSTOMER ADDRESS, and CUSTOMER CITY/STATE/ZIP. Be sure to place the word "CUSTOMER" on the first line and the remaining words are displayed on the second line. Be sure that the script file displays all the data in the customer_reportview. Execute this script file.

4. Copy the customer_report_format.sql file to the customer_report_format2.sql file. Change the customer_report_format2.sql script file so that the format of the CUSTOMER_NAME column is 35 characters wide. Execute the script file.

5. Generate a representative_report.sqlscript file. Be sure that this script file contains the representative_report view that displays the sales representative full name as first name, space, and last name (named REP_NAME), his/her total commission (named REP_COMM), and his/her commission rate (named REP_RATE). The sales representative name should be displayed as last name, comma, space, and first name. Include a statement to display the view. Execute this script file to create and display the view.

6. Develop a script file named representative_report_format.sql that formats the data from the representative_reportview. The total commission should appear as currency and the commission rate should appear with two decimal places and a leading zero in front of the decimal point. Modify the column headings so that "Sales Rep." and "Name" are on separate lines, "Total" and "Commission" are on separate lines, and "Commission" and "Rate" are on separate lines. The final command should display the complete view. Execute this script file.

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M91341039
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in PL-SQL

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As