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

اريد المساعده في حل السؤال Help Me


Don,t leave Me Alone

Recommended Posts

السلام عليكم ورحمة الله وبركاته
اريد المساعده في حل السؤال..
Disply the month name and year name in the field date from trip table
حاولت وحاولت بس ماقدرت

:)

تم تعديل بواسطة Don,t leave Me Alone
رابط هذا التعليق
شارك

SELECT TO_CHAR(hire_date,'month   year')
FROM employees WHERE employee_id BETWEEN 122 AND 133
/



و الـ OutPut فى المرفقات.

اذا لم يكن هذا ما تريده فأوصف سؤالك بمزيد من التفاصيل.

و بالتوفيق

output.txt

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

شكرا اخوي hanyfreedom
بجد ماقصرت فعلا هو المطلوب

حكمل حل الواجب ولو واجهت اي صعوبه راح اسال اذا ممكن لاني مبتدئه ف الاوراكل واتمى اني اتعلمه اكثر لانو ممتع

يسلمو :)

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

السلام عليكم ورحمة الله وبركاته
حليت الواجب وبقي كم سؤال ماعرفت احلهم
Q1:display the number of passenger in each trip?
المطلوب اظهار pno عن طريق group by trip ولا يوجد بينهم ترابط حاولت ب الربط الخارجي بس مازبط
Q2:retrieve the passenger name , trip number where the name begins with the letter A and tno is 312?
فكرت ب الربط بعدم التساوي والربط الخارجي بس ماعرفت

ارجو المساعده والرد السريع

تحياتي..

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

Q1:display the number of passenger in each trip


SELECT   COUNT(employee_id),
        department_id
FROM employees GROUP BY department_id
/



Q2:retrieve the passenger name , trip number where the name begins with the letter A and tno is 312


SELECT last_name,
      department_id
FROM employees WHERE last_name LIKE 'A%' AND department_id = 50
/



بس انا هنا مكتبتش 312 لأنى لو كتبتها مش هيدى نتيجة فأستبدلتها بـ 50

هات Description الجداول المسخدمه فى اى سؤال بتسأله حتى تسهل الامر على اللى بيرد عليك .

اتمنى تكون الفكرة وصلت و بالتوفيق

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

شكرا ويعطيك العافيه
حل السؤال الثاني صحيح اما السؤال الاول مازبط معايه
وبصراحه مافهمت السؤال
والمشكله مافي ربط مباشر بين الجدولين وماقدرت اربط بينهم

display the number of passenger in each trip..


[يسار][/left]

SQL> select *
 2  from trip; TNO DTRIP    SOURCE     DESTINAT
---------- -------- ---------- --------
      312 05/03/09 Taif       Abha
      311 07/01/09 Jeddah     Riyadh
      356 01/02/09 Taif       Jeddah



[/يسار]

SQL> select *
 2  from passenger; PNO PNAME
---------- --------
    12345 Ali
    98765 Mohammed
    22222 Khaled



وهذا الجدول الثالث ربط بين الجدولين trip & passenger

SQL> select * 
 2  from booking; BNO        PNO        TNO
---------- ---------- ----------
        2      22222        312
       12      98765        311
        7      12345        312

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

SELECT   COUNT(pno),
        tno
FROM booking GROUP BY tno;



Like in HR :-

SELECT   COUNT(employee_id),
        manager_id
FROM employees GROUP BY manager_id;



have a nice day

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

لو سمحتوا اريد حل للسؤالين ..

Q1;Displays job with the lowest average salary of each job..


Q2;Displays employee name , salaries , department numbers and average salaries for all employees who make more than average salary in their department..


وشكرا..

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

Q1;Displays job with the lowest average salary of each job.



SELECT   job_id,
        Avg(salary)
FROM employees GROUP BY job_id
HAVING   Avg(salary) = (SELECT   MIN(Avg(salary))
                       FROM employees GROUP BY job_id)
/



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

Q2;Displays employee name , salaries , department numbers and average salaries for all employees who make more than average salary in their department



SELECT   last_name,
        salary,
        department_id,
        Avg(salary)
FROM employees GROUP BY department_id,
        salary,
        last_name
HAVING   salary >  ANY (SELECT   Avg(salary)
                       FROM employees GROUP BY department_id)
/

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

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

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

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

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

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

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

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