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
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,...
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...
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 CubesSum application that prompts the user for a non-negative integer and then displays the...
Create a CubesSum application that prompts the user for a non-negative integer and then displays the sum of the cubes of the digits.   b) Modify the application to determine what integers of two, three, and four digits are equal to the sum of the cubes of their digits.(Java Programming )
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax...
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax is 1.35% of the property’s assessed value, which will be entered by the user. a. Prepare a Planning Chart for the application. b. Draw a sketch of an appropriate interface. Be sure to follow the GUI design guidelines covered in the chapter. The guidelines are summarized in Figure 2-20. (If you want to include an image in the interface, you can either use your...
In C# Create a GUI application that calculates and displays the total travel expenses of a...
In C# Create a GUI application that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: Number of days on the trip Amount of airfare, if any Amount of car rental fees, if any Number of miles driven, if a private vehicle was used Amount of parking fees, if any Amount of taxi charges, if any Conference or seminar registration fees, if any Lodging charges, per...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT