الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

الرجاء تصحيح الواجب بسررررررررررررعة

Featured Replies

بتاريخ:

-عرض اسم الإدارة رقم 10 ؟
مؤشر بسيط


declare
2 x varchar2 (20);
3 cursor mm is
4 select dname from dept
5 where deptno=10;
6 begin
7 open mm ;
8 fetch mm into x ;
9 dbms_output.put_line(x);
10 close mm;
11 end ;





2-تعديل في رواتب الموظفين الذين على وظيفة

'CLERK'
لتصبح جميعها 2000 ؟


1 declare
2 salary emp.sal %type;
3 jobing emp.job %type;
4 cursor mm is
5 select sal , job from emp;
6 begin
7 open mm;
8 loop
9 fetch mm into salary ,jobing;
10 exit when mm %notfound;
11 if jobing ='CLERK' then
12 update emp
13 set sal=2000
14 where salary=sal;
15 end if;
16 end loop;
17 close mm;
18* end ;






عمل مؤشر يقوم بعرض الراتب والعمولة بحيث اذا كان الراتب 1000 يضع العمولة 200 واذاكان الراتب 2000 يضع
العمولة 200وغير ذلك يضع العمولة null?

1 declare
2 salary emp.sal %type;
3 commiton emp.comm %type;
4 cursor mm is
5 select sal , comm from emp;
6 begin
7 open mm;
8 loop
9 fetch mm into salary,commiton;
10 exit when mm %notfound;
11 if salary =1000 then
12 update emp
13 set comm=200
14 where salary=sal;
15 elsif
16 salary =2000 then
17 update emp
18 set comm=200
19 where salary=sal;
20 else
21 update emp
22 set comm= null;
23 end if;
24 end loop;
25 close mm;
26 end ;




حذف الموظفين الذين على وظيفة CLERK فقط للمؤظف الذي يحمل اسم SMITH ?
ودا معرفتش اعمله

بتاريخ:

السلام عليكم و رحمة الله

ما في داعي عمل مؤشر في الفرع 1 ، 2 حيث أن :

-عرض اسم الإدارة رقم 10 ؟

SELECT dname FROM dept WHERE deptno  = 10;



أما بالنسبة :
2-تعديل في رواتب الموظفين الذين على وظيفة

'CLERK'
لتصبح جميعها 2000 ؟


UPDATE emp SET sal = 2000 WHERE ename = 'CLERK';



أما بالنسبة للفرع الثالث فهو صحيح مع إجراء بعض التعديلات

11 if salary =1000 then
12 update emp
13 set comm=200
14 where salary=sal;
15 elsif
16 salary =2000 then
17 update emp
18 set comm=200
19 where salary=sal;
20 else
21 update emp
22 set comm= null;
23 end if;


يصبح كالتالي :

IF salary IN ( 1000 , 2000 ) THEN
UPDATE emp SET comm = 200 WHERE sal = salary;
ELSE
UPDATE emp SET comm = NULL
END IF;



أما بالنسبة للسؤال الأخير :

حذف الموظفين الذين على وظيفة CLERK فقط للمؤظف الذي يحمل اسم SMITH ?
ودا معرفتش اعمله


الحل كالتالي :
DELETE FROM emp WHERE JOB = 'CLERK' AND ENAME = 'SMITH';



وشكرا

بتاريخ:
  • كاتب الموضوع

الف شكر ليك
بس هي طالبة الحل يكون بمؤشر عشان الدرس عن المؤشر

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

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

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

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

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

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.