cara menggabungkan beberapa tabel pada mysql
berikut ini cara masuk ke mysql
D:\>cd\xampp\mysql\bin
D:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.41 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
pilih database yang anda ingin kan
mysql> use sekolah
Database changed
mysql> select siswa.nis,siswa.nama,matapelajaran.nama_mp,nilai.nilai
-> from siswa,matapelajaran,nilai
-> where nilai.nis=siswa.nis and matapelajaran.kode_mp=nilai.kode_mp
-> and siswa.nis="001";
+-----+------+----------------+-------+
| nis | nama | nama_mp | nilai |
+-----+------+----------------+-------+
| 001 | kka | bahasa inggris | 90 |
| 001 | kka | matematika | 80 |
| 001 | kka | Geografi | 76 |
+-----+------+----------------+-------+
3 rows in set (0.00 sec)
mysql>
berikut ini cara masuk ke mysql
D:\>cd\xampp\mysql\bin
D:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.41 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
pilih database yang anda ingin kan
mysql> use sekolah
Database changed
mysql> select siswa.nis,siswa.nama,matapelajaran.nama_mp,nilai.nilai
-> from siswa,matapelajaran,nilai
-> where nilai.nis=siswa.nis and matapelajaran.kode_mp=nilai.kode_mp
-> and siswa.nis="001";
+-----+------+----------------+-------+
| nis | nama | nama_mp | nilai |
+-----+------+----------------+-------+
| 001 | kka | bahasa inggris | 90 |
| 001 | kka | matematika | 80 |
| 001 | kka | Geografi | 76 |
+-----+------+----------------+-------+
3 rows in set (0.00 sec)
mysql>
0 comments:
Post a Comment