Skip to content

Instantly share code, notes, and snippets.

@maulvi
Last active September 25, 2017 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maulvi/e2722e57469343f59252687790d68fa6 to your computer and use it in GitHub Desktop.
Save maulvi/e2722e57469343f59252687790d68fa6 to your computer and use it in GitHub Desktop.
database minggu 3
select employees.emp_no, first_name, last_name, count(dept_no) jml_dpt
from employees join dept_emp on employees.emp_no = dept_emp.emp_no
group by employees.emp_no, first_name, last_name
having count(dept_no) = 2;
SELECT concat(first_name," ",last_name) as nama, (YEAR(hire_date)-YEAR(birth_date)) as umur
FROM employees group BY umur limit 5;
SELECT * FROM employees.salaries WHERE MONTH(from_date) = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment