Create an anonymous PL/SQL block that accepts the current salary and raise percentage through SQL*Plus substitution variables and calculate the new salary based on the input: new salary := old salary * ( 1 + raise percentage / 100 ) The result should be stored in a PL/SQL variable and printed on the screen. Your program should handle NULL values. A NULL value entered for either one or both of the input values is equivalent to a numerical 0 (Note: To associate NULL values for your SQL*Plus substitution variables, just enter NULL.
SET SERVEROUTPUT ON;
DECLARE
new_salary NUMBER(10,2);
current_salary NUMBER(10,2):=10000;
raise_percent NUMBER(10,2):=5;
BEGIN
new_salary := NVL(current_salary,0) * ( 1 + NVL(raise_percent,0)/
100 );
DBMS_OUTPUT.PUT_LINE( new_salary );
END;
Output( None of the variable is NULL)
SET SERVEROUTPUT ON;
DECLARE
new_salary NUMBER(10,2);
current_salary NUMBER(10,2);
raise_percent NUMBER(10,2):=5;
BEGIN
new_salary := NVL(current_salary,0) * ( 1 + NVL(raise_percent,0)/
100 );
DBMS_OUTPUT.PUT_LINE( new_salary );
END;
Output ( Salary is NULL)
SET SERVEROUTPUT ON;
DECLARE
new_salary NUMBER(10,2);
current_salary NUMBER(10,2):=10000;
raise_percent NUMBER(10,2);
BEGIN
new_salary := NVL(current_salary,0) * ( 1 + NVL(raise_percent,0)/
100 );
DBMS_OUTPUT.PUT_LINE( new_salary );
END;
Output ( Raise is NULL)
Create an anonymous PL/SQL block that accepts the current salary and raise percentage through SQL*Plus substitution...
PL/SQL Auction Program 1. Create a user xyz, who is the owner of the auction. Create the schema, and package. 2. Create users x1 and x2 who are the participants in the auction. They will need acces to the package. 3. Bid on the same item and record your observations. Verify all scenarios. Upload the files with the missing code and a detailed sample run. AUCTION OWNER.TXT SQL> conn / as sysdba Connected. SQL> drop user xyz cascade; User dropped....
1. Create a PL/SQL program block that determines the top students with respect to GPA. Assume that the database has four tables. Student(SSN, SName, DOB, Major) , Grade(SSN, CNo, Grade(0,1,2,3,4)) and Course table(CNo,CName, Credit Hour), Prerequisite(CNo, PreCNo); Student and couse data ae given in the following SQL statements a. Accept a number n as user input with SQL*Plus telling top n%. b. In a loop get the SName and GPA of the top n% people with respect to GPA. c....