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

عندي كم سؤال محتاجين لحل لاهنتوا


skiming

Recommended Posts

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

الله يسلمكم عندي 13 سؤال وماعرفت جوابهم لأن توني الحين مبتدأ أبي حلهم وماأتوقع يكونوا صعبين عليكم


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

الله يسلمكم عندي 13 سؤال وماعرفت جوابهم لأن توني الحين مبتدأ أبي حلهم وماأتوقع يكونوا صعبين عليكم

السؤال الأول

A) List names of all employees who work in DALLAS


:blink: List NAME, DEPARTMENT NUMBER, and SALARY for all employees with the comment HIGHEST PAID next to the salary of those employees whose is highest in their department

C) List NAME, DEPARTMENT NO, and SALARY for all employees who earn more than the maximum salary of an employes in the RESEARCH department


D) List NAME, JOB of all employees, and: The Employee's salary if employee earn more than 1500; The message MET THE TARGET if employee earn exactly 1500; The message BELOW 1500 if employee earn than 1500

E) List employee name, employee number, and job of all employee who do not work in department 20 or 30

F) List name and salary of all employee who earn more than the average salary of an employee in their department

G) List name and salary of the highest paid employee beside the PRESIDENT

H) List name of all employee that have exactly two A's in the name (not necessarily consecutive)

I) List name and salary of all employee who earn less than immediate subordinates

J) List name of all department that have no employee

K) List employee name,job,salary,grade, and department Name of all employee except clerks. Sort on salary displaying highest salary first

L) Write a SQL query that would accept a string as a parameter, and verify that it is in the format m*n, where m, and n are alphabets. Your query should display the parameter string together with a 'Y' if the string format is valid, 'N' otherwise



الأجابات لاهنتوا وفي وقت لاحق سوف أضع الإجابات التي قمت بالإجابه عليها

تحياتي

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

السلام عليكم

A – 
SELECT ENAME , DNAME 
FROM EMP E , DEPT D 
WHERE E.DEPTNO = D.DEPTNO AND E.DEPTNO IN (SELECT DEPTNO FROM DEPT WHERE LOC ='DALLAS') ;

-----
B -
SELECT ENAME , MAX(SAL) , DEPTNO 
FROM EMP WHERE (SAL ,DEPTNO) IN ( SELECT MAX(SAL), DEPTNO FROM EMP GROUP BY DEPTNO)
GROUP BY ENAME , DEPTNO ;
------------
C – 
SELECT ENAME , DEPTNO , SAL
FROM EMP WHERE SAL >ALL ( SELECT SAL FROM EMP WHERE DEPTNO = (SELECT DEPTNO FROM DEPT WHERE DNAME = 'RESEARCH')) ;
-------------
D –
برجاء تحديد حل هذا السؤال هل تريده  من خلال السيكول ام البي ال ؟
-------------------
E – 
SELECT ENAME , EMPNO , JOB 
FROM EMP WHERE DEPTNO NOT IN (20 , 30) ;
--------------------
F –
SELECT ENAME , DEPTNO 
FROM EMP WHERE SAL > ( SELECT AVG(SAL) FROM EMP )
ORDER BY 2 ;
-------------------
G –
السؤال غير مفهوم الرجاء التوضيح 
-----------------
H –
الذى فهمته انك تريد من يوجد بثاني حرف من اسمه حرف 
A
واليك الاجابة على هذا النحو
SELECT ENAME 
FROM EMP WHERE ENAME LIKE ('_A%') ;
---------------------------
I –
السؤال غير مفهوم الرجاء التوضيح 
-----------------------
J – 
SELECT ENAME , DNAME
FROM EMP E , DEPT D 
WHERE E.DEPTNO(+) = D.DEPTNO AND E.DEPTNO IS NULL ;
----------------------
K –
SELECT ENAME , JOB , SAL , GRADE , DNAME 
FROM EMP E , DEPT D , SALGRADE
WHERE E.DEPTNO = D.DEPTNO AND SAL BETWEEN LOSAL AND HISAL AND JOB <> 'CLERK'
ORDER BY SAL DESC ;
----------------
L – 
السؤال غير مفهوم الرجاء التوضيح



وشكرا
ميجا

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

D) List NAME, JOB of all employees, and: The Employee's salary if employee earn more than 1500; the message MET THE TARGET if employee earn exactly 1500; the message BELOW 1500 if employee earn than 1500

هالسؤال في SQL حله وهني راح يكون إستخدام Decode


====================================

H) List name of all employee that have exactly two A's in the name (not necessarily consecutive


هذا السؤال يقصد به كل شخص في اسمه حرف A مكرر مرتين

مثال ADAMS
يحتوي على حرفين

Ali
يحتوي على حرف واحد فقط فأنه لن يظهر في الكود فقط الذين يحتون على حرفين سيظهرون

أنا جربت هالكود
Select ename
From emp
Where ename like '%A%A%';

وعطاني المطلوب
========================
I) List name and salary of all employee who earn less than immediate subordinates
هذا السؤال يعني راتب الموظفين الذين يأخذون راتب أقل من المسؤول عنهم
مثال المدير يأخذ 5000 الموظفين اللي تحته من يأخذون أقل منه
========================
G) List name and salary of the highest paid employee beside the PRESIDENT
السؤال يقصد به جميع الموظفين الذين يستلمون أعلى راتب بعد الموظف الذي رتبته PRESIDENT



وتسلم على التعاون أخوي وماقصرت

تحياتي

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

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

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

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

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

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

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

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