الانتقال إلى المحتوى
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.

امثلة Sql بسيطة ومفيده ان شاء الله

Featured Replies

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

Display all employees number , last name , salary , department number and the avarage salary in thieir department for all employees

select e.employee_id , e.last_name , e.department_id , avg(d.salary)
from employees e , employees d
where e.DEPARTMENT_ID = d.DEPARTMENT_ID
group by e.employee_id , e.last_name , e.department_id
order by e.DEPARTMENT_ID

  • الردود 36
  • المشاهدات 8.9k
  • البداية
  • اخر رد

أكثر المشاركين في هذا الموضوع

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

Show all employees who were on the day of the week on which the highest number employees wrere hired

select employee_id ,last_name , to_char(hire_date,'day') "day"
from employees
where to_char(hire_date,'day') = 
(select to_char(hire_date,'day')
  from employees
  group by to_char(hire_date,'day')
  having count(employee_id) = 
							 (select max(count(employee_id))
							   from employees
							 group by to_char(hire_date,'day')))
order by employee_id;

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

Create an anniversary overview based on the hire date of the employees . sort the anniversary in ascending order

select last_name, to_char(hire_date,'month dd') BIRTHDAY
from employees
order by to_char (hire_date , 'DDD');

تم تعديل بواسطة أحمد السيد احمد

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

فقط ارجوا الدعاء الكثير فى الصلاة ممن يستفيد

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

what is a Role ? a role is a named of related privileges that can be granted to the user . thise method makes it easier to revoke and maintain privileges . A user can have access to several roles .and several users can be assigned the same role

* create role manager :
CREATE ROLE manager;
* grant peivileges to a role :
GRANT create table , create view TO manager;
* grant a role to users :
GRANT manager TO AHMED , MOHAMMED;

بتاريخ:

مشكووووووووووووووووووووووووووررررررررر


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

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

Update the job and the salary of employee 114 to match the job of employee 205 and salary of employee 168

Update employees
set job_id = ( select job_id
				  from employees
				  where employee = 205) ,
  salary = (select salary
				 from employees
				 where employee_id = 168)
where employee_id = 114;

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

select emp_id , hiredate , salary , mgr_id from employees for employee_id whose greater than 200 and inesrt these values into the sal_history and mgr_history tables using a multitable INSERT

INESRT ALL
	 into sal_history values (empid , hiredate , sal)
	 into mgr_history values (empid,mgr,sal)
select employee_id empid , hire_date hiredate , salary sal , manager_id mgr
from employees
where employee_id > 200;

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

EXAMPLE of the FLASHBACK VERSION QUERY

1- select salary from employees where employee_id = 107;   result	salary = 4200
2- update employees set salary = salary * 1.30
where employee_id = 107;
  commit;
3- select salary from employees 
   versions between scn minvalue and maxvalue
  where employee_id = 107; result 5460 and 4200

تم تعديل بواسطة أحمد السيد احمد

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

CONDITIONAL INSERT FIRST .. EXAMPLE

INSERT FIRST
WHEN SAL>1000	 THEN
  INTO special_sal VALUES ( DEPTID , SAL )
WHEN HIREDATE LIKE ('%99%') THEN
  INTO hiredate_history_99 VALUES( DEPTID , HIREDATE )
ELSE
INTO hiredate_history VALUES (DEPTID,HIREDATE)
SELECT DEPARTMENT_ID  DEPTID , SUM(SALARY)  SAL , MAX(HIRE_DATE) HIREDATE
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID;

بتاريخ:

4.gif

  • بعد 2 أسابيع...
بتاريخ:
  • كاتب الموضوع

GROUP BY ROLLUP

جرب المثال ده وشوف الناتج وهتعرف بتعمل ايه
SELECT department_id,job_id,sum(salary)
FROM employees
WHERE department_id < 60
GROUP BY ROLLUP (department_id,job_id);

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

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

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

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

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

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.