SQL: Menampilakan Data dari Banyak Tabel

SELECT emp.ename, dept.deptno, dept.dname
FROM emp, dept
WHERE emp.deptno = dept.deptno;
SELECT DISTINCT emp.job, dept.loc
FROM emp, dept
WHERE emp.deptno = dept.deptno AND dept.deptno = 30;
SELECT emp.ename, dept.dname, dept.loc
FROM emp, dept
WHERE emp.deptno = dept.deptno AND emp.comm IS NOT NULL;
SELECT emp.ename, dept.dname
FROM emp, dept
WHERE emp.deptno = dept.deptno AND emp.ename LIKE '%A%';
SELECT emp.ename, emp.job, dept.deptno, dept.dname
FROM emp, dept
WHERE emp.deptno = dept.deptno AND LOWER(dept.loc) = 'dallas';
SELECT e.empno, e.ename AS pegawai, m.empno, m.ename AS manager
FROM emp e, emp m
WHERE e.mgr = m.empno;
Advertisements
Posted in SQL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s