Tugas SQL Basic

Dari Tugas Sebelumnya Buatlah SQL dari Masing -Masing Nomor :

1. Cari nama dan alamat untuk semua pegawai yang bekerja pada departemen “Research”

    SELECT EMP.FNAME, EMP.LNAME, EMP.ADDRESS

    FROM EMPLOYEE EMP, DEPARTMENT DPT

    WHERE EMP.DNAME = ‘Research’ AND DPT.DNUMBER = EMP.DNO;

    2. Tampilkan nomor project, nomor department, nama manager department, alamat dan tanggal lahir untuk project yang berlokasi di Stafford.

      SELECT PRJ.PNUM, PRJ.DNUM,EMP.FNAME, EMP.LNAME, EMP.ADDRESS, EMP.BDATE

      FROM PROJECT PRJ, DEPARTMENT DPT, EMPLOYEE E

      WHERE PRJ.PLOCATION = ‘Stafford’ AND PRJ.DNUM = DPT.DNUMBER AND DPT.MGRSSN = E.SSN;

      3. Cari nama pegawai yang bekerja pada semua project yang di control oleh nomor department 5

        SELECT EMP.FNAME, EMP.LNAME

        FROM PROJECT PRJ, DEPARTMENT DPT, EMPLOYEE E

        WHERE DPT.DNUMBER = ‘5’ AND PRJ.DNUM = DPT.DNUMBER AND DPT.DNUMBER = EMP.DNO;

        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