Skip to content

Instantly share code, notes, and snippets.

@lil5
Created March 5, 2019 15:28
Show Gist options
  • Save lil5/bb84d550b8889ca4b98c344862932378 to your computer and use it in GitHub Desktop.
Save lil5/bb84d550b8889ca4b98c344862932378 to your computer and use it in GitHub Desktop.
SQL Refrence
SELECT department.dept_id AS dept_id, COUNT(employee.dept_id) AS count, SUM(employee.salary) AS sum_of_salary
FROM department
INNER JOIN employee ON department.dept_id = employee.dept_id
GROUP BY department.dept_id
ORDER BY department.dept_id ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment