Create simple reports in an oracle database

Assignment Help PL-SQL Programming
Reference no: EM13771279

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.

Databse Schema

Name                 Null?    Type

----------------------------------------------------- -------- ------------------------------------

CUST_ID              NOT NULL CHAR(4)

CUST_NAME          VARCHAR2(30)

CUST_STREET       VARCHAR2(20)

CUST_CITY          VARCHAR2(20)

CUST_STATE        CHAR(2)

CUST_ZIP           CHAR(5)

CUST_BALANCE   NUMBER(8,2)

CUST_LIMIT      NUMBER(8,2)

REP_ID           CHAR(3)

 

SQL> DESCRIBE REP;

 Name        Null?    Type

 ----------------------------------------------------- -------- ------------------------------------

 REP_ID        NOT NULL CHAR(3)

 REP_LNAME   VARCHAR2(20)

 REP_FNAME   VARCHAR2(15)

 REP_STREET   VARCHAR2(20)

 REP_CITY       VARCHAR2(15)

 REP_STATE      CHAR(2)

 REP_ZIP           CHAR(5)

 REP_COMM      NUMBER(7,2)

 REP_RATE       NUMBER(3,2)

Reference no: EM13771279

Questions Cloud

Financial management in nonprofit organizations : Discuss financial management in nonprofit organizations and write an essay that compares and contrasts the application of financial management techniques in nonprofit and for-profit organizations.
What causes of action does steve have : Steve is renting a property from Billy. One evening Steve tripped and fell down the stairs. What causes of action does Steve have? What remedies does he have for the faulty heater?
Prevailing market price of these contracts in spring : Assume that in 2007 the U.S. Government issued a debt security with a purpose of consolidating all of the federal national debt. At the time of the issue, each security was priced at $15,000 and promised to pay 10% coupon rate indefinitely, just as i..
The function of the organization : 1. The function of the organization, as well as its mission and vision. 2. Potential advantages of membership in the organization. 3. Provide resource information for new members, including contact information, membership requirements, and organizati..
Create simple reports in an oracle database : laboratory provides practice in the use of SQL commands to create simple reports in an Oracle database
Importance of marketing research in the development : Justify the importance of marketing research in the development of kudler fine food's marketing strategy and tactics. Identify the areas where additional market research is needed;
Build composite picture by demonstrating ancient heroicmodel : Build your composite picture by demonstrating the ancient heroic model is used to develop a character in a modern movie.
Advice from a christian perspective : Assume Frederick comes to you for advice from a Christian perspective. He knows that the Bible says something about " love your neighbor" and "turn the other cheek" and "do not resist an evil-doer," but he is just not sure how to make sense of all..
The market for loanable funds and government policy : The following graph shows the market for loanable funds. For each of the given scenarios, adjust the appropriate curve on the graph to help you complete the questions that follow. This change in the tax treatment of saving causes the equilibrium inte..

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a procedure named basket

After a shopper completes an order, a procedure is called to update the following columns in the Basket table: orderplaced, subtotal, shipping, tax and total.

  Create a view named productsummary

Create a view named ProductSummary that uses the view you created in exercise 4. This view should return some summary information about each product.

  Write sql commands to implement profile

Write SQL commands which would implement this profile. Next, write query that would list profile, profile resource name, and limit value for the new profile.

  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.

  Display all the columns from the orders table

Display all the columns from the Orders table that were paid with a Visa Card and have been shipped to the customer (hint: not a null). Order results by the Item Price in descending order.

  Write sql statement which creates stored procedure

Write SQL statement which creates stored procedure with one int input parameter. Stored procedure selects supplierId field and total of all Count field values for each group of supplierId's from Part table.

  Review problem and run required statement to create table

Please note that for "Table Employees" due to length of the table description and page size limit, I have broken it into 2 parts for better visibility, please make sure to use all the given attributes from the table.

  Create and populate the database system using sql server

Global Car Club (GCC) is a small individually owned club which loans cars to its members. GCC first formed in 2009; has over more than 100 good mixes of members and counting.

  Description of vulnerability, exploit and attack software

Describe the vulnerability that the attack exploits, including how or why the vulnerability exists; what versions of software are vulnerable.

  Write a pl/sql solution that displays the registration

Write a PL/SQL solution that displays the registration and the maximum and the minimum miles travelled by a car during the rental period for all the bookings where the booking has been paid for.

  Problem of select command in sql

Write a SELECT statement that returns these columns from the Products table: The ListPrice column A column that uses the CAST function to return the ListPrice column with 1 digit to the right of the decimal point A column that uses the CONVERT fun..

  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.

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