Name Null?

Examine the structure of the EMPLOYEES table that exists in your schema.
Name Null? Type
————————– ————— ———————
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
DEPARTMENT_ID NUMBER(4)
You successfully create a GET_MAX procedure to find the maximum salary in the department of
a specified employee.
You then code a PL/SQL block to display the maximum salary in the departments of the first five
employees in the EMPLOYEES table.
View the Exhibit. Examine the procedure and the block of PL/SQL code.

What is the outcome of executing the block of PL/SQL code?

Examine the structure of the EMPLOYEES table that exists in your schema.
Name Null? Type
————————– ————— ———————
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
DEPARTMENT_ID NUMBER(4)
You successfully create a GET_MAX procedure to find the maximum salary in the department of
a specified employee.
You then code a PL/SQL block to display the maximum salary in the departments of the first five
employees in the EMPLOYEES table.
View the Exhibit. Examine the procedure and the block of PL/SQL code.

What is the outcome of executing the block of PL/SQL code?

A.
It executes successfully and gives the required output.

B.
It gives an error because ROWNUM cannot be used in cursor definitions.

C.
It gives an error because usage of the %ROWCOUNT attribute is not valid.

D.
It executes successfully, but does not give the required output because the procedure call
resets the %ROWCOUNT value.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


gelete

gelete

A

SELECT * FROM (
SELECT last_name, department_id, salary FROM employees WHERE ROWNUM < 11
) ORDER BY department_id;

LAST_NAME DEPARTMENT_ID SALARY
PEREZ -500 29900
KING 1 24000
PEREZ 2 10000
Smith 5 40000
GÓMEZ 30 20000
GONZALEZ 30 50000

1. KING
Max salary in KING's department is 24000
2. GONZALEZ
Max salary in GONZALEZ's department is 50000
3. Smith
Max salary in Smith's department is 40000
4. PEREZ
Max salary in PEREZ's department is 29900
5. GÓMEZ
Max salary in GÓMEZ's department is 50000
— Fetched 5th record —