Answer to Question #272355 in Databases | SQL | Oracle | MS Access for sam

Question #272355

1.     Write a PL/SQL code to print all tables up to a number fetched from a table using implicit cursors.


1
Expert's answer
2021-11-28T05:26:02-0500
BEGIN
    FOR emprec IN(SELECT department_name,
                       d.department_id,
					   first_name,
                       last_name,
                       job_id,
                       salary
                FROM   departments d
                       join employees e
                         ON e.department_id = d.department_id
                WHERE  job_id = 'ST_CLERK'
                       AND salary > 3000) LOOP
        dbms_output.Put_line('Name: '
		                     ||emprec.first_name
                             ||' '
							 ||emprec.last_name||chr(9)
							 ||' Department: '
                             ||emprec.department_name||chr(9)
                             ||' Department ID: '
                             ||emprec.department_id||chr(9)
                             ||' Job ID: '
                             ||emprec.job_id||chr(9)
                             ||' Salary: '
                             ||emprec.salary);
    END LOOP;
END; 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS