Salam TIK SMA XAVEGA.
Sebelum mengerjakan tugas yang akan saya berikan, silahkan Anda buat dahulu sebuah file database dengan nama seperti di bawah ini. (Apabila kurang jelas, silahkan lihat/baca buku Modul Pembelajaran TIK kelas XI pada ).
Di dalam database KURSUS tersebut, buatlah 4 buah tabel sbb:Tabel 1 : GURU
Tabel 2 : PROGRAM
Tabel 3 : SISWA
Tabel 4 : ABSEN
Setelah keempat tabel tersebut selesai anda buat, berikutnya buatlah relasional tabel seperti gambar di bawah ini!
Apabila tabel dan relasi tabel telah siap, sekarang silahkan Anda buat/kerjakan query berikut menggunakan SQL. Silahkan Anda publish/kirimkan syntax/rumus SQL yang Anda buat paling lambat tanggal 31 Mei 2013.
- Tampilkan siwa yang mengikuti paket program tertentu menggunakan parameter field PAKET_PROGRAM. Field yang ditampilkan adalah:NIS, NAMA_SISWA, PAKET_PROGRAM, NAMA_GURU, JAM_MASUK, JAM_PULANG, dan LAMA_JAM_BELAJAR.
- Tampilkan field NIS, NAMA_SISWA, TANGGAL_LAHIR, UMUR, PAKET_PROGRAM, dan BIAYA_KURSUS.
Ketentuan/keterangan soal nomor 2 adalah sebagai berikut:- Perhitungan Umur menggunakan fungsi TAHUN SEKARANG - TAHUN TANGGAL_LAHIR.
- BIAYA_KURSUS diperoleh dengan ketentuan sebagai berikut:
- Jika PAKET_PROGRAM = MS-Windows, BIAYA_KURSUS = 75000,
- Jika PAKET_PROGRAM = MS-Office, BIAYA_KURSUS = 150000,
- Jika PAKET_PROGRAM = Photoshop, BIAYA_KURSUS = 300000,
- Jika PAKET_PROGRAM = Web Design, BIAYA_KURSUS = 200000,
Selamat mengerjakan. Semoga berhasil.
46 comment:
Nama : Vanny Julianti
Kelas : XIS2
Jawaban Soal No 1 :
SELECT SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
ABSEN.JAM_PULANG-ABSEN.JAM_MASUK)*24 AS LAMA_JAM_BELAJAR
FROM (PROGRAM INNER JOIN (GURU INNER JOIN SISWA ON GURU.KD_GURU = SISWA.KD_GURU) ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM) INNER JOIN ABSEN ON SISWA.NIS = ABSEN.NIS;
Jawaban Soal No 2
SELECT SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
Year(Now())-Year(SISWA.TANGGAL_LAHIR) AS UMUR,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows",75000,(IIf(PROGRAM.PAKET_PROGRAM="MS-Office",150000,(IIf(PROGRAM.PAKET_PROGRAM="Photoshop",300000,200000))))) AS BIAYA_KURSUS
FROM PROGRAM INNER JOIN SISWA ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
1.
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
ABSEN.JAM_PULANG-ABSEN.JAM_MASUK)*24 AS LAMA_JAM_BELAJAR
FROM (PROGRAM INNER JOIN (GURU INNER JOIN SISWA ON GURU.KD_GURU = SISWA.KD_GURU) ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM) INNER JOIN ABSEN ON SISWA.NIS = ABSEN.NIS
;
2.
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
Year(Now())-Year(SISWA.TANGGAL_LAHIR) AS UMUR,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows",75000,(IIf(PROGRAM.PAKET_PROGRAM="MS-Office",150000,(IIf(PROGRAM.PAKET_PROGRAM="Photoshop",300000,200000))))) AS BIAYA_KURSUS
FROM PROGRAM INNER JOIN SISWA ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM
;
1. PARAMETERS PAKET_PROGRAM TEXT;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
[JAM_PULANG-JAM_MASUK]*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
YEAR(NOW())-YEAR([SISWA.TANGGAL_LAHIR]) AS USIA,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows","Rp 75.000",
IIf(PROGRAM.PAKET_PROGRAM="MS-Office","Rp 150.000",
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop","Rp 300.000","Rp
200.000"))) AS BIAYA
FROM SISWA INNER JOIN PROGRAM ON SISWA.KD_PROGRAM =
PROGRAM.KD_PROGRAM;
Jawaban Soal No 1 :
SELECT SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
ABSEN.JAM_PULANG-ABSEN.JAM_MASUK)*24 AS LAMA_JAM_BELAJAR
FROM (PROGRAM INNER JOIN (GURU INNER JOIN SISWA ON GURU.KD_GURU = SISWA.KD_GURU) ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM) INNER JOIN ABSEN ON SISWA.NIS = ABSEN.NIS;
Jawaban Soal No 2
SELECT SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
Year(Now())-Year(SISWA.TANGGAL_LAHIR) AS UMUR,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows",75000,(IIf(PROGRAM.PAKET_PROGRAM="MS-Office",150000,(IIf(PROGRAM.PAKET_PROGRAM="Photoshop",300000,200000))))) AS BIAYA_KURSUS
FROM PROGRAM INNER JOIN SISWA ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM;
1
SELECT
Siswa.NIS,
siswa.Nama_Siswa,
Program.Paket_Program,
Guru.Nama_Guru,
absen.Jam_Masuk,
absen.Jam_Pulang,
Hour(absen.jam_Pulang)-Hour(absen.Jam_Masuk) AS lama_jam_belajar
FROM ((siswa INNER JOIN guru ON siswa.KD_Guru = guru.KD_guru) INNER JOIN program ON siswa.KD_program = program.KD_program) INNER JOIN absen ON siswa.NIS = absen.NIS;
2
SELECT
Siswa.NIS,
Siswa.Nama_Siswa,
Siswa.Tanggal_Lahir,
Year(now())-Year(siswa.Tanggal_lahir) as Umur,
Program.Paket_Program,
iif(Program.Paket_Program = "MS-Windows" , 75000, iif(Program.Paket_Program = "MS-Office" , 150000, iif(Program.Paket_Program = "Photoshop", 300000, 200000))) as Biaya_Kursus
FROM (siswa inner join absen on siswa.nis=absen.nis) inner join program on siswa.KD_program=program.KD_program;
William Saputra
Nama : Manahap SP Sihaloho
No : 22
1. PARAMETERS PAKET_PROGRAM Text ;
SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
PROGRAM.PAKET_PROGRAM,
GURU.NAMA_GURU,
ABSEN.JAM_MASUK,
ABSEN.JAM_PULANG,
([JAM_PULANG]-[JAM_MASUK])*24 AS LAMA_JAM_BELAJAR
FROM ((SISWA INNER JOIN ABSEN ON SISWA.NIS=ABSEN.NIS)
INNER JOIN GURU ON SISWA.KD_GURU=GURU.KD_GURU)
INNER JOIN PROGRAM ON SISWA.KD_PROGRAM=PROGRAM.KD_PROGRAM
WHERE PROGRAM.PAKET_PROGRAM=[PAKET_PROGRAM];
2. SELECT
SISWA.NIS,
SISWA.NAMA_SISWA,
SISWA.TANGGAL_LAHIR,
Year(Now())-Year(SISWA.TANGGAL_LAHIR) AS UMUR,
PROGRAM.PAKET_PROGRAM,
IIf(PROGRAM.PAKET_PROGRAM="MS-Windows",75000,
IIf(PROGRAM.PAKET_PROGRAM="MS-Office",150000,
IIf(PROGRAM.PAKET_PROGRAM="PhotoShop",300000,200000)))
AS BIAYA_KURSUS
FROM PROGRAM INNER JOIN SISWA
ON PROGRAM.KD_PROGRAM = SISWA.KD_PROGRAM;
Siswa yang telah mengumpulkan tugas (sd. tgl. 31 Mei 2013):
1. ADE
2. ANDHIKA MAKNAWIJAYA
3. ANDRE PP
4. ARDYANTO
5. CATHERINA TRI WAHYUNI
6. CHINTHYA
7. DENI CORNELIUS
8. DENY WIJAYA
9. DWIKY DARMAWAN
10. ERWIN K.
11. EVENS DOMINIUS
12. FERDINAND GUSTIAN
13. FITRIANI BUDIMAN
14. HARDI WIJAYA
15. JENNI
16. JENNIFER DESTERA LUMBANGAOL
17. LILI MARLINA
18. MANAHAP SP SIHALOHO
19. MARIA P
20. OKTAVIANUS ADRIAN
21. RENALDY SAPUTRA
22. RICKY APRILYANTO
23. RIZKY NOVIANTI
24. ROBERTO TANSIR
25. RYO KIANTO
26. SANDI TIRTA ADI KUSUMA
27. SHANELLA WARTONO
28. SONYA CAROLINA
29. STEPHEN WIJAYA
30. STEVEN WILLIAM
31. SUGIANTO
32. TIALI
33. VANNY JULIANTI
34. VERONIKA N.D
35. VINNY TJINDAR BUMI
36. WENDY CHRISTIAN
37. WILLIAM SAPUTRA
Siswa yang belum mengumpulkan tugas hingga tanggal 31 Mei 2013:
1. ANDREAN VALENTINUS
2. FANDY FRANSISCO
3. IMELDA
4. PRASETYO AWAL
5. WENNICA
6. YELKY LIANSYAH
7. YULIANA
Silahkan segera mengerjakan dan mengumpulkan tugas di atas, diberi waktu hingga tanggal 02 Juni 2013.
Post a Comment
Silahkan tuliskan komentar Anda dengan sopan dan bijak, tidak menyinggung pihak lain, tidak berisi link aktif sehingga dapat dianggap spam.
Anda tidak punya ID khusus untuk berkomentar?
Gunakan pilihan Name / URL, URL bisa dkosongkan atau diisi dengan alamat Facebook Anda..
Terimakasih atas kunjungannya. Salam XAVEGA