You are on page 1of 2

laporan praktikum Basdat 3 Angga Christana 31575

1. mysql> select * from barang;


+------+------------+-----------------------------+---------+--------+
| No
| Kodebarang | Nama
| harga
| Status |
+------+------------+-----------------------------+---------+--------+
|
1 | nk05
| Handphone Nokia E50
| 1150000 | Ada
|
|
2 | ss45
| Handphone Samsung SGH-C450 | 450000 | Kosong |
|
3 | se05
| Handphone Sony Erricson T50 | 625000 | Ada
|
|
4 | nk23
| Handphone Nokia 2300
| 315000 | Ada
|
|
5 | ss17
| Handphone Samsung SGH-Z170 | 1000000 | Kosong |
+------+------------+-----------------------------+---------+--------+
5 rows in set (0.01 sec)
2. mysql> select * from barang where Nama like '%Samsung%';
+------+------------+----------------------------+---------+--------+
| No
| Kodebarang | Nama
| harga
| Status |
+------+------------+----------------------------+---------+--------+
|
2 | ss45
| Handphone Samsung SGH-C450 | 450000 | Kosong |
|
5 | ss17
| Handphone Samsung SGH-Z170 | 1000000 | Kosong |
+------+------------+----------------------------+---------+--------+
2 rows in set (0.01 sec)
3. mysql> select * from barang where Harga between 400000 and 800000;
+------+------------+-----------------------------+--------+--------+
| No
| Kodebarang | Nama
| harga | Status |
+------+------------+-----------------------------+--------+--------+
|
2 | ss45
| Handphone Samsung SGH-C450 | 450000 | Kosong |
|
3 | se05
| Handphone Sony Erricson T50 | 625000 | Ada
|
+------+------------+-----------------------------+--------+--------+
2 rows in set (0.00 sec)
4.

mysql> select * from barang where Kodebarang like '%ss%';

+------+------------+----------------------------+---------+--------+
| No
| Kodebarang | Nama
| harga
| Status |
+------+------------+----------------------------+---------+--------+
|
2 | ss45
| Handphone Samsung SGH-C450 | 450000 | Kosong |
|
5 | ss17
| Handphone Samsung SGH-Z170 | 1000000 | Kosong |
+------+------------+----------------------------+---------+--------+
2 rows in set (0.00 sec)
5. mysql> select * from barang where Harga < 1000000 and Status='Ada';
+------+------------+-----------------------------+--------+--------+
| No
| Kodebarang | Nama
| harga | Status |
+------+------------+-----------------------------+--------+--------+
|
3 | se05
| Handphone Sony Erricson T50 | 625000 | Ada
|
|
4 | nk23
| Handphone Nokia 2300
| 315000 | Ada
|
+------+------------+-----------------------------+--------+--------+
2 rows in set (0.01 sec)
6. mysql> select * from barang where Harga between 500000 and 1000000 or Status='Kosong';
+------+------------+-----------------------------+---------+--------+
| No
| Kodebarang | Nama
| harga
| Status |
+------+------------+-----------------------------+---------+--------+
|
2 | ss45
| Handphone Samsung SGH-C450 | 450000 | Kosong |
|
3 | se05
| Handphone Sony Erricson T50 | 625000 | Ada
|
|
5 | ss17
| Handphone Samsung SGH-Z170 | 1000000 | Kosong |
+------+------------+-----------------------------+---------+--------+

laporan praktikum Basdat 3 Angga Christana 31575


3 rows in set (0.69 sec)

You might also like