Question

In: Computer Science

Create a PLSQL block that retrieves and displays information for a specific project based on project...

Create a PLSQL block that retrieves and displays information for a specific project based on project ID. Display the following on a single row of output: project ID, project name, number of pledges made, total dollars pledged, and the average pledge amount

Solutions

Expert Solution

set serveroutput on
DECLARE           --declaration of variables in Plsql block
proj_name         d_p.projname%type;     -- projectname
proj_id           d_p.idproj%type;       -- projectid
pledge_count      d_pl.pledgeamt%type;   -- total pledge count
pledge_average    d_pl.pledgeamt%type;   -- average pledge
pledge_sum        d_pl.pledgeamt%type;   -- sum of all pledges
BEGIN
SELECT d_p.idproj, projname, sum(pledgeamt), avg(pledgeamt), count(pledgeamt)
/* The above line Selects the following identity under a object d_p */
into proj_id, proj_name, pledge_count, pledge_sum, pledge_average
from d_pl, d_p
 /* condition clause */
where d_pl.idproj = d_p.idproj
and d_p.idproj = &proj_id
group by d_p.idproj, projname;
 -- display
DBMS_OUTPUT.PUT_LINE(
'Project ID: ' || proj_id
||' Project Name: ' || proj_name
||' Total Dollars Pledged : ' || pledge_sum
||' Total Pledge: ' || pledge_count
||' Average Amount Pledged: ' || pledge_average
);
end

-- & /* */ denotes comments remove them before execution hope it clears your doubt


Related Solutions

Based on the information below, create a project schedule (Gantt Chart). Assign tasks to either Workgroup...
Based on the information below, create a project schedule (Gantt Chart). Assign tasks to either Workgroup or Individual. Project: Vacation Team: "Workgroup 1", "Individual" Start/End: February 19 - May 26 START A. February 19: Vacation participation must be confirmed Time allotted: 7 days i. Confirm participation Time needed: 1 day ii. Research vacation deals Time needed: 1 days iii. Decide on destination Time needed: 2 days iv. Create travel list Time needed: 1 day Slack available: 2 days B. February...
If it needs more information be specific. JavaScript Functions Create the makeBranches() function that will be...
If it needs more information be specific. JavaScript Functions Create the makeBranches() function that will be used to append node branches to the node tree diagram. The function will have two parameters named treeNode and nestedList. The treeNode parameter stores the current node from the source article and the nestedList parameter stores the structure of the node tree displayed in the web page. Add the commands described in the steps below. Each time the makeBranches() function is called, it is...
Create a project schedule based on task dependencies and resource constraints
Create a project schedule based on task dependencies and resource constraints
Using SQL Developer Question 1 Create a block to retrieve and display pledge and payment information...
Using SQL Developer Question 1 Create a block to retrieve and display pledge and payment information for a specific donor. For each pledge payment from the donor, display the pledge ID, pledge amount, number of monthly payments, payment date, and payment amount. The list should be sorted by pledge ID and then by payment date. For the first payment made for each pledge, display “first payment” on that output row. Question 2 Redo question 1, but use a different cursor...
create a project charter GENERAL PROJECT INFORMATION Project Name: Project Sponsor: Project Manager: Email Address: Phone...
create a project charter GENERAL PROJECT INFORMATION Project Name: Project Sponsor: Project Manager: Email Address: Phone Number: Organizational Unit: Process Impacted: Expected Start Date: Expected Completion Date: Expected Savings: Estimated Costs: PROBLEM, ISSUE, GOALS, OBJECTIVES, DELIVERABLES Problem or Issue: Purpose of Project: Business Case: Goals/Metrics: Expected Deliverables: PROJECT SCOPE & SCHEDULE Within Scope Outside of Scope PROJECT RESOURCES & COSTS Project Team Support Resources Special Needs PROJECT BENEFITS & CUSTOMERS Process Owner Key Stakeholders Final Customers Expected Benefits PROJECT RISKS,...
Phase 1 – ERD In this phase of the project you will create an ERD based...
Phase 1 – ERD In this phase of the project you will create an ERD based upon the following requirements and business rules. Limit your ERD to entities and relationships based on the business rules showed here. In other words, do not add realismto your design by expanding or refining the business rules.  However, make sure you include all attributes needed that would permit the model to be successfully implemented, including all primary and foreign keys. 1.Trinity College (TC) is divided...
Create a PowersTable application that displays a table of of powers. ( Java Programing )
Create a PowersTable application that displays a table of of powers. ( Java Programing )
In this exercise, you will create a program that displays the amount of a cable bill....
In this exercise, you will create a program that displays the amount of a cable bill. The amount is based on the type of customer, as shown in Figure 10-30. For a residential cus- tomer, the user will need to enter the number of premium channels only. For a business customer, the user will need to enter the number of connections and the number of premium channels. Use a separate void function for each customer type. If necessary, create a...
In this exercise, you will create a program that displays the amount of a cable bill....
In this exercise, you will create a program that displays the amount of a cable bill. The amount is based on the type of customer shown in figure 10-30. For a residential customer, the user will need to enter the number of premium channels only. For a business customer, the user will need to enter the number of connections and the number of premium channels. Use a separate void function for each customer type. Enter your C++ instructions into the...
We will use the following information to create the profit model. Based on the data in...
We will use the following information to create the profit model. Based on the data in the tables below, create the profit model for Donuts to Go and Muffins to Go. Profit = Total revenue X num. of units – Variable Expenses X num. of units – Fixed Expenses (what are the values for Total Revenue, Variable Expenses and Fixed Expenses?) Assume that each customer will buy one donut(or muffin) and one cup of coffee. Come to class with both...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT