RELASI ANATR 2 TABLE
BANK1.
buat
database bank………
·
this is table
nasabah *
CREATE TABLE `bank`.`nasabah` (`Id_nasabah` VARCHAR( 10 ) NULL ,`Nama_nasabah` VARCHAR( 20 ) NULL ,`Alamat_nasabah` VARCHAR( 50 ) NULL) ENGINE = MYISAM ;
INSERT INTO `bank`.`nasabah` (`Id_nasabah` ,`Nama_nasabah` ,`AlamatNnasabah`)
VALUES (
'AA001', 'rudi', 'jln.sepat'), ('AB002', 'yuni', 'jln.baung'), (
'CC003', 'hani', 'jln.gurame'), (
'CD004', 'kiki', 'jln.nila'), (
'CD005', 'lala', 'jln.mujair');
èHasil table nasabah id_nasabah,
Nama_nasabah, Alamat_nasabah;
THIS IS CREAT TABLE REKENING
èTHIS
IS TABLE NASABAH ID_NASABAH, NO_REKENING, SALDO, Kode_cabang;
INSERT INTO `bank`.`rekening` (`Id_nasabah` ,`No_rekening` ,`Saldo` ,`Kode_cabang`)
VALUES (
'AA001', '001000123', '20000000', 'A123'
), (
'AB002', '002000123', '5000000', 'B123'
), (
'CC003', '003000123', '75000000', 'C123'
), (
'CD004', '004000123', '20000000', 'D123'
), (
'DD005', '005000123', '1500000', 'E123'p;'jln.mujair');
·
THIS IS TABLE CABANG*
CREATE TABLE `bank`.`cabang` (
`Kode_cabang` VARCHAR( 5 ) NULL ,
`Nama_cabang` VARCHAR( 15 ) NULL ,
`Kota` VARCHAR( 15 ) NULL
`Nama_cabang` VARCHAR( 15 ) NULL ,
`Kota` VARCHAR( 15 ) NULL
) ENGINE = MYISAM ;
DD005', '005000123', '1500000', 'E123'
èHASILNYA
TABLE CABANG*
INSERT INTO `bank`.`cabang` (
`Kode_cabang` ,
`Nama_cabang` ,
`Kota`
`Nama_cabang` ,
`Kota`
)VALUES (
'A123', 'JKT01', 'Jakarta Pusat'
), (
'B123', 'JKT02', 'Jakarta Selatan'
), (
'C123', 'BDO01', 'Bandung'
), (
'D123', 'SBY01', 'Surabaya'
), (
'E123', 'DPK01', 'Depok'
èHASILNYA
RELASI KE 3 TABLE NASABAH,REKENING
RELASI ANATR 2 TABLE MAHASISWA
A.CREATE DATABASE MAHASISWA
CREATE TABLE MAHASISWA
CREATE TABLE `bab8_mahasiswa`.`mahasiswa` (
`npm` VARCHAR( 15 ) NOT NULL ,
`nama` VARCHAR( 25 ) NOT NULL ,
`kelas` VARCHAR( 10 ) NOT NULL
) ENGINE = MYISAM `nama` VARCHAR( 25 ) NOT NULL ,
`kelas` VARCHAR( 10 ) NOT NULL
èHASILNYA
INSERT INTO `bab8_mahasiswa`.`mahasiswa`(`npm`,`nama`,`kelas`)
VALUES ('201043501089', 'abigail', '4b'), ('201043501092', 'reddi', '4b'), ('2010431093', 'reva', '4c'), ('201043501095', 'chyntia', '4d'), ('201043501096', 'steven', '4b');
VALUES ('201043501089', 'abigail', '4b'), ('201043501092', 'reddi', '4b'), ('2010431093', 'reva', '4c'), ('201043501095', 'chyntia', '4d'), ('201043501096', 'steven', '4b');
CREATE TABLE NILAI
èHASILNYA
CREATE TABLE `bab8_mahasiswa`.`nilai` (
`npm` VARCHAR( 15 ) NOT NULL ,
`no_mk` VARCHAR( 25 ) NOT NULL ,
`mid` FLOAT( 10 ) NOT NULL ,
`final` FLOAT( 10 ) NOT NULL
`no_mk` VARCHAR( 25 ) NOT NULL ,
`mid` FLOAT( 10 ) NOT NULL ,
`final` FLOAT( 10 ) NOT NULL
) ENGINE = MYISAM ;
INSERT INTO `bab8_mahasiswa`.`nilai` (`npm` ,`no_mk` ,`mid` ,`final`)
VALUES ('201043501089', '110011', '78', '80'), ('201043501092', '120011', '80', '87'
VALUES ('201043501089', '110011', '78', '80'), ('201043501092', '120011', '80', '87'
), ('2010431093', '130011', '69', '75'), ('201043501095', '140011', '80', '60'), ('201043501096', '150011', '85', '90');
oke bgt nh tugasny,,hahaha
BalasHapus