Assalamualaikum Wr. Wb
HALLO 👌
Tugas 4 Praktek Pemrograman SQL
Melanjutkan Tugas Minggu Lalu
Progdi Sistem Informasi Universitas Muria Kudus
use "201553028"
insert into Barang
values ('001','supermie','mie instan', 1500, 40)
insert into Barang
values ('002','pantene','shampo',
18000, 200)
insert into Barang
values ('003','closeup','pasta gigi', 14000, 150)
insert into Barang
values ('004','Marlboro','rokok',
20000, 300)
insert into Barang
values ('005','morinaga','susu bayi', 16500, 250)
insert into Barang
values ('006','indomilk','susu kaleng', 18000, 100)
insert into Barang
values ('007','maknyus','beras',
20000, 100)
insert into Barang
values ('008','ultra milk','susu', 18000, 150)
insert into Barang
values ('009','djarum','rokok',
12500, 200)
insert into Barang
values ('010','tropical','minyak goreng', 25000, 250)
select * from Barang
select * from supplier
create table pembelian
(Nonota varchar(10) primary key,
kdbrg varchar(10) foreign key references barang(kdbrg),
kdsup varchar(10) foreign key references supplier(kdsup),
tanggalbeli date,
jumlahbeli int,
hargabeli int,
total int
)
insert into pembelian
values('HG001','001','SUP006','03/01/2017','200','2000','400000')
insert into pembelian
values('HG002','004','SUP002','02/01/2017','150','3000','450000')
insert into pembelian
values('HG003','007','SUP001','02/01/2017','300','4000','1200000')
insert into pembelian
values('HG004','002','SUP003','03/01/2017','150','5000','750000')
insert into pembelian
values('HG005','003','SUP004','04/01/2017','350','6000','2100000')
insert into pembelian
values('HG006','005','SUP005','04/01/2017','200','7000','1400000')
insert into pembelian
values('HG007','006','SUP007','05/01/2017','250','8000','2000000')
insert into pembelian
values('HG008','008','SUP008','05/01/2017','100','9000','900000')
insert into pembelian
values('HG009','009','SUP009','06/01/2017','350','2000','700000')
insert into pembelian
values('HG010','010','SUP010','07/01/2017','300','9000','2700000')
select*from pembelian
Waalaikumussalam Wr. Wb
Semoga bermanfaat 😉😉