Dosen : A.Bachris
Nama : Insan Kamalia R.
NIM : 4312122006
Kelas :TMJ REG 1
1.B.
2.A.
3.D
1.B.
Tabel Dokter |
Tabel Praktek |
Tabel Spesialis |
2.A.
SELECT D.kd_dokter, D.Nama_dokter
FROM tabel_dokter D, tabel_spesialis S
WHERE D.kd_spesialis = S.kd_spesialis
AND S.Spesialis = 'Dalam'
FROM tabel_dokter D, tabel_spesialis S
WHERE D.kd_spesialis = S.kd_spesialis
AND S.Spesialis = 'Dalam'
2.B.
SELECT D.Nama_dokter, D.HP
FROM tabel_dokter D, tabel_spesialis S
WHERE D.kd_spesialis = S.kd_spesialis
AND S.Spesialis = 'Bedah'
FROM tabel_dokter D, tabel_spesialis S
WHERE D.kd_spesialis = S.kd_spesialis
AND S.Spesialis = 'Bedah'
2.C.
SELECT D.kd_dokter, D.Nama_dokter, D.HP
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND S.Jam_Mulai = '08:15:00'
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND S.Jam_Mulai = '08:15:00'
2.D.
SELECT D.kd_dokter, D.Nama_dokter, D.HP
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND S.Jam_Selesai = '20:00:00'
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND S.Jam_Selesai = '20:00:00'
2.E
SELECT D.Nama_dokter, S.Hari, D.kd_spesialis
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND S.Hari = 'Selasa'
WHERE D.kd_dokter = S.kd_dokter
AND S.Hari = 'Selasa'
2.F.
SELECT D.Nama_dokter, D.HP, S.Jam_Mulai, S.Jam_Selesai
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND D.kd_Spesialis = 'KDG'
FROM tabel_dokter D, tabel_praktek S
WHERE D.kd_dokter = S.kd_dokter
AND D.kd_Spesialis = 'KDG'
3.A.
SELECT COUNT( nama_dokter )
FROM tabel_dokter
FROM tabel_dokter
3.B.
SELECT COUNT( kd_spesialis )
FROM tabel_dokter
WHERE kd_spesialis = 'KDG'
FROM tabel_dokter
WHERE kd_spesialis = 'KDG'
3.C
SELECT *
FROM tabel_praktek
WHERE Jam_selesai - Jam_mulai = (
SELECT MAX( jam_selesai - jam_mulai )
FROM tabel_praktek )
FROM tabel_praktek
WHERE Jam_selesai - Jam_mulai = (
SELECT MAX( jam_selesai - jam_mulai )
FROM tabel_praktek )
SELECT *
FROM tabel_praktek
WHERE Jam_selesai - Jam_mulai = (
SELECT MIN( jam_selesai - jam_mulai )
FROM tabel_praktek )
FROM tabel_praktek
WHERE Jam_selesai - Jam_mulai = (
SELECT MIN( jam_selesai - jam_mulai )
FROM tabel_praktek )
3.E.
SELECT *
FROM tabel_praktek
WHERE kd_dokter = (
SELECT AVG( DATEDIFF( jam_selesai, jam_mulai ) )
FROM tabel_dokter ) ;
FROM tabel_praktek
WHERE kd_dokter = (
SELECT AVG( DATEDIFF( jam_selesai, jam_mulai ) )
FROM tabel_dokter ) ;
No comments:
Post a Comment