Basis Data
1.SELECT NAMA, GAJI FROM DOKTER
2.SELECT * FROM DOKTER WHERE NAMA = 'EMA UTAMI'
3.SELECT KD_DOKTER, ALAMAT FROM DOKTER WHERE NAMA ='EMI SUSANTI'
4.SELECT KD_DOKTER AS "KODE DOKTER", NAMA AS "NAMA DOKTER", ALAMAT [ALAMAT DOKTER] FROM DOKTER
5.SELECT DISTINCT Kd_dokter FROM jadwal_dokter
6.SELECT TOP 3 * FROM dokter
7.SELECT * FROM dokter ORDER BY NAMA ASC
8.SELECT * FROM dokter ORDER BY nama DESC
9.SELECT * FROM PASIEN WHERE PERIKSA BETWEEN 2 AND 4 ORDER BY PERIKSA
10.SELECT * FROM PASIEN WHERE NAMA LIKE 'R%'
11.SELECT * FROM PENYAKIT WHERE PENYAKIT LIKE '%N'
12.SELECT * FROM OBAT WHERE OBAT LIKE '%CTM%'
13.SELECT * FROM DOKTER WHERE NAMA LIKE '_U%'
14.SELECT * FROM dokter WHERE ALAMAT LIKE '%YOGYAKARTA%' OR ALAMAT LIKE '%BANDUNG%'
15.SELECT * FROM PASIEN WHERE NAMA LIKE 'R%' AND NAMA LIKE '%A'
16.SELECT * FROM PASIEN WHERE NAMA LIKE 'R%' OR NAMA LIKE '%A'
17.SELECT * FROM PASIEN WHERE ALAMAT LIKE '[JY]OG[JY]A%'
18.SELECT GETDATE()
19.SELECT UPPER(NAMA) FROM DOKTER
20.SELECT LOWER(NAMA) FROM DOKTER
21.SELECT COUNT(KD_DOKTER) FROM DOKTER
22.SELECT SUM(PERIKSA) [JUMLAH] FROM PASIEN
23.SELECT AVG (PERIKSA) [RATA RATA] FROM PASIEN
24.SELECT COUNT(*), ALAMAT FROM DOKTER GROUP BY ALAMAT
25 SELECT LEFT(NAMA,2) FROM DOKTER
26.SELECT RIGHT(NAMA,1) FROM DOKTER
27.SELECT PENYAKIT, LEN(PENYAKIT) [PANJANG KARAKTER] FROM PENYAKIT
28.SELECT KD_OBAT, OBAT, KD_OBAT + OBAT [GABUNGAN] FROM OBAT
29.SELECT LEFT(NAMA,5) [NAMA PANGGILAN] FROM DOKTER
30.SELECT MIN(periksa) [MINIMAL] FROM pasien
31.SELECT MAX(periksa) [MAXIMAL] FROM pasien
32.SELECT DATEPART(yyyy,GETDATE()) [Tahun Sekarang]
33.SELECT DATENAME(MM, GETDATE()) [BULAN SEKARANG]
34.SELECT DATEPART(DD, GETDATE()) [TANGGAL SEKARANG]
35.SELECT DATEPART(HH, GETDATE()) [JAM SEKARANG DI KOMPUTER SAYA]
36.SELECT DATEPART(MI, GETDATE()) [MENIT SEKARANG DI KOMPUTER SEKARANG]
37.SELECT DATEPART(SS, GETDATE()) [DETIK SEKARANG DI KOMPUTER SEKARANG]
38.SELECT NAMA,SUBSTRING(NAMA,3,1) [HURUF KE 3] FROM pasien
39.SELECT TANGGAL_LAHIR, DATEDIFF(DD,TANGGAL_LAHIR,GETDATE()) [USIA]FROM PASIEN
40.select a.kd_dokter, b.nama, a.hari from jadwal_dokter a join dokter b on a.kd_dokter=b.kd_dokter
41.select a.nama, b.shift from dokter a inner join jadwal_dokter b on a.kd_dokter=b.kd_dokter where b.shift='pagi'
42.select a.nama, a.gender, b.hari from dokter a inner join jadwal_dokter b on a.kd_dokter=b.kd_dokter where a.gender='L' and b.hari='senin'
43.select a.kd_penyakit, b.penyakit from resep a join penyakit b on a.kd_penyakit=b.kd_penyakit
44.select distinct a.kd_pasien, b.nama from resep a join pasien b on a.kd_pasien=b.kd_Pasien
45.select a.kd_obat, b.obat from resep a join obat b on a.kd_obat=b.kd_obat
46.select * from obat where kd_obat not in (select kd_obat from resep)
0 komentar:
Posting Komentar