الانتقال إلى المحتوى

اخي مصطفى لقد قمت بحل هذا السوال


susu1910

Recommended Posts

 Create a PL/SQL block to retrieve the last name and department ID of each employee from the (EMP) table for those employees whose EMPID is less than 7500.
1- From the values retrieved calculate the annual commission of every employee and print it out using DBMS_OUTPUT.PUT_LINE.
2- Using a loop, retrieve the employee name information and the salary information from the PL/SQL tables and display it in the window, using DBMS_OUTPUT.PUT_LINE. Display these details for the first 15 employees in the PL/SQL tables


الحل :
select last_name,department_ID from emp where empid<7500
select Employee.Emp_ID,Emp_Name ,sum(commission) From Employee inner join Emp_commission On Employee.Emp_ID=Emp_commission.Emp_ID
Group By Employee.Emp_ID,Emp_Name
declare

cursor Emp is
select
Emp_Name,Sallery
from Employee where ROWNUM<=15;
begin
for r_Emp in Emp loop
dbms_output.put_line(r_Emp.Emp_Name||' '||
r_Emp.salary );
end loop;
end;

iهل هذا الحل صحيح ارجو الرد سريعا

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية