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

رجاء مساعدتي مع جزيل الشكر


susu1910

Recommended Posts

Write a PL/SQL block to declare
• Variable called (SAL) to store the salary of an employee.
• In the executable part of the program, do the following:
1. Store an employee name in substitution variable.
2. Store his or her salary in the (SAL) variable.
3. If the salary is less than 3,000, give the employee a raise of 500 and display the message “<Employee Name>’s salary updated” in the window by Using DBMS_OUTPUT.PUT_LINE.
4. If the salary is more than 3,000, print the employee’s salary in the format,“<Employee Name> earns ……” by Using DBMS_OUTPUT.PUT_LINE.
5. Draw down the program diagram using word tools for flowcharts
6. Undefined the variable that stores the employee’s name at the end of the script.
 Write Another PL/SQL block to store the salary of an employee in substitution variable. In the executable part of the program, do the following:
1- Calculate the annual salary as salary * 12.
2- Calculate the bonus as indicated below:
3- If total sum > 50’000 give the employee
4- If total sum equal or greater than 30’000 and equal 50’000 give the employee
5- Display the amount of the bonus in the window in the following format: “The bonus is $…..” by Using DBMS_OUTPUT.PUT_LINE.
 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

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

Write a PL/SQL block to declare
• Variable called (SAL) to store the salary of an employee.
• In the executable part of the program, do the following:
1. Store an employee name in substitution variable.
2. Store his or her salary in the (SAL) variable.
3. If the salary is less than 3,000, give the employee a raise of 500 and display the message “<Employee Name>’s salary updated” in the window by Using DBMS_OUTPUT.PUT_LINE.
4. If the salary is more than 3,000, print the employee’s salary in the format,“<Employee Name> earns ……” by Using DBMS_OUTPUT.PUT_LINE.
5. Draw down the program diagram using word tools for flowcharts
6. Undefined the variable that stores the employee’s name at the end of the script.
الحل
بس اسم الفريبول x

SET SERVEROUTPUT ON DECLARE

x    NUMBER(10);
BEGIN FOR emp_record IN (SELECT FIRST_NAME ,SALARY  FROM employees )
 LOOP
if emp_record.salary < 3000 then 
x:=  emp_record.SALARY+500 ;
  DBMS_OUTPUT.PUT_LINE( emp_record. FIRST_NAME ||' is
  '||x);   
else 
DBMS_OUTPUT.PUT_LINE( emp_record.FIRST_NAME ||' is earns
  '||emp_record.SALARY);   
end if;
 END LOOP; 
END;

باقى الاسئله حاول بس انت اكتب اى كزد واحنا معاك
بالتوفيق

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

يعطيك العافية اخي مصطفى اريد السوال عن نوع نسخة الاوركل التي لديك
لقد وضعت الكود عندي (انا املك نسخة 9i) مع التعديل لكنه اعط كافة المشتركين دون العمل بالقانون ولماذا استخدمة loop
وقد جرب بناء كود لكنه لم يعمل واريد معرفة السبب لو سمحت هذا هو الكود
create or replace procedure eee_sal(x_sal in number) is
employee_name emp.ename %type;
Xsal emp. sal %type;
begin
select ename , sal
into employee_name, Xsal
from emp
where sal = x_sal and ename = employee_name;
--------------
if Xsal < 3000
then
update emp
set sal = sal +500
where sal =x_sal;
dbms_output.put_line('the employee name ');
------------
else
dbms_output.put_line('the employee name ');
end if;
end eee_sal;

كان ينتهي ب compiled successfully لكن في مرحلة الاختبار يفشل -_-

تم تعديل بواسطة mr_spot
رابط هذا التعليق
شارك

يعطيك الف عافية و بتمنالك تكون بخير وصحة جيدة
انا اعمل على نفس المشروع كنت ع بجاوب على نفس الموضوع السوال الذي حللته لكن بكود انا صممته الرجاء اخباري اي يوجد الخطاء في الكود

على اي نسخة اوركل انت تعمل
مع تحياتي -_-

تم تعديل بواسطة mr_spot
رابط هذا التعليق
شارك

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

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

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

×   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.

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

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

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