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

اريد اجابة هذا السؤال خاص بview


ابوخطاب

Recommended Posts


You need to create a view EMP_VU. The view should allow the users to manipulate the
records of only the employees that are working for departments 10 or 20.
Which SQL statement would you use to create the view EMP_VU?

وجزاكم الله خير

ابوخطاب
[email protected]

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

السلام عليكم
تفضل:

Create View Emp_Vu (Empno,
                   Ename,
                   Sal,
                   Deptno)
         As Select A.Empno,
                   A.Ename,
                   A.Sal,
                   B.Deptno  
              From Emp A,
                   Dept B
             Where A.Deptno = B.Deptno
               And B.Deptno In (10, 20);



أو...

Create View Emp_Vu (Empno,                    
                   Ename,                    
                   Sal,                    
                   Deptno)          
         As Select Empno,                    
                   Ename,                    
                   Sal,                    
                   Deptno                 
              From Emp
             Where Deptno In (10, 20);



تم وضع المثال الأول لكي تعرف كيفية عمل View من اكثر من جدول.

بالتوفيق.

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

  • بعد 1 شهر...

You need to create a view EMP_VU. The view should allow the users to manipulate the
records of only the employees that are working for departments 10 or 20.
Which SQL statement would you use to create the view EMP_VU

السلام عليكم ورحمه الله وبركاته
المطلوب هو عمل تقييد لعمليات الاضافه والتعديل على هذا الاستعلام بشرط
عدم تعديل رقم القسم عن 10 او 20

ولذلك نحتاج الى with check option in crating the view
create or replace view emp_vu
as select * from employees
where department_id in (10,20)
with check option;

والجمله الاخيره تمنع اى محاوله لعمل تعديل او اضافه سجل جديد من خلال ال emp_vu view
ولكن يسمح فقط بالاضافه او التعديل لاى سجل بشرط ان يكون رقم القسم 10 او 20


والله الموفق والمستعان

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

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

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

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

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

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

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

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