Akila0-code / AKILA

0 stars 0 forks source link

اريد حل هذا التمرين بالعربية #1

Open Akila0-code opened 5 hours ago

Akila0-code commented 5 hours ago

اريد حل هذا التمرين بالعربية Objective: Practice basic SELECT, WHERE, ORDER BY, and LIMIT. You have a database with two tables: Employees and Departments. Employees (emp_id, emp_name, department_id, salary, hire_date); Departments (department_id, department_name);

  1. Write a query to select all employees from the Employees table.
  2. Find all employees who earn more than 50,000
  3. List all employees hired after January 1, 2020.
  4. Sort the employees by salary in descending order and limit the result to 5 rows.
  5. Find the names of employees and the names of their departments.
  6. Find the total number of employees in each department.
  7. Calculate the average salary of employees in each department.
  8. Identify departments that have more than 3 employees.
  9. Calculate the total salary paid to employees in each department.
  10. Find all pairs of employees who work in the same department and compare their salaries. Show the employee names, department names, and their respective salaries.
  11. Find all departments where the average employee salary is greater than 70,000. Use the HAVING clause.
  12. List departments that have more than 10 employees.
  13. Find departments where the total salary paid to employees exceeds 500,000.
  14. Find employees who work in the 'HR' department.
  15. List departments with the number of employees in each.
  16. Find the department(s) with the highest average employee salary. (use LIMIT).
  17. List departments where no employees have a salary more than 100,000
Akila0-code commented 5 hours ago

s Objective: Practice basic SELECT, WHERE, ORDER BY, and LIMIT. You have a database with two tables: Employees and Departments. Employees (emp_id, emp_name, department_id, salary, hire_date); Departments (department_id, department_name);

  1. Write a query to select all employees from the Employees table.
  2. Find all employees who earn more than 50,000
  3. List all employees hired after January 1, 2020.
  4. Sort the employees by salary in descending order and limit the result to 5 rows.
  5. Find the names of employees and the names of their departments.
  6. Find the total number of employees in each department.
  7. Calculate the average salary of employees in each department.
  8. Identify departments that have more than 3 employees.
  9. Calculate the total salary paid to employees in each department.
  10. Find all pairs of employees who work in the same department and compare their salaries. Show the employee names, department names, and their respective salaries.
  11. Find all departments where the average employee salary is greater than 70,000. Use the HAVING clause.
  12. List departments that have more than 10 employees.
  13. Find departments where the total salary paid to employees exceeds 500,000.
  14. Find employees who work in the 'HR' department.
  15. List departments with the number of employees in each.
  16. Find the department(s) with the highest average employee salary. (use LIMIT).
  17. List departments where no employees have a salary more than 100,000