Last active
September 25, 2017 02:05
-
-
Save maulvi/e2722e57469343f59252687790d68fa6 to your computer and use it in GitHub Desktop.
database minggu 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT concat(first_name," ",last_name) as nama, (YEAR(hire_date)-YEAR(birth_date)) as umur | |
FROM employees group BY umur limit 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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