You are on page 1of 1

alter table t_barang add stok_barang int

create table t_barang(


c_barang char(6) not null,
n_barang varchar2(20) null,
s_barang varchar2(10) null,
constraint p_barang primary key (c_barang));
create table t_pasok (
c_pasok char(6) not null,
c_barang char(6) not null,
c_suplier char(6) not null,
constraint p_pasok primary key (c_pasok),
constraint f_pasok_barang foreign key (c_barang) references t_barang(c_barang),
constraint f_pasok_suplier foreign key (c_suplier) references t_suplier(c_suplie
r));
create table t_suplier (
c_suplier char(6) not null,
n_suplier varchar2(30) null,
a_suplier varchar2(50) null,
constraint p_suplier primary key (c_suplier));
ALTER TABLE t_suplier
MODIFY a_suplier char(40);
create table t_customer (
c_customer char(6) not null,
n_customer varchar2(30) null,
a_customer varchar2(50) null,
constraint p_customer primary key (c_customer));
create table t_pembelian (
c_pembelian char(6) not null,
c_barang char(6) not null,
c_customer char(6) not null,
jumlah_pembelian number(38) null,
constraint p_pembelian primary key (c_pembelian),
constraint f_pembelian_barang foreign key (c_barang) references t_barang(c_baran
g),
constraint f_pembelian_customer foreign key (c_customer) references t_customer(c
_customer));

You might also like