You are on page 1of 3

table no:1

1 create table bus_unit


2 (bus_u_code varchar2(10),
3 bus_u_name varchar2(25),
4* constraint busunit_pk primary key (bus_u_code)

table no:2
1 create table category
2 (cat_bus_code varchar2(10),
3 cat_code varchar2(10),
4 cat_name varchar2(25),
5 constraint cat_pk primary key(cat_bus_code),
6* constraint cat_bus_code_fk foreign Key (cat_bus_code) References bus_unit (
bus_u_code))

table no:3

1 create table item_detail


2 (id_code varchar2(10),
3 id_name varchar2(10),
4 id_cat_code varchar2(10),
5 constraint id_pk primary key (id_code),
6* constraint id_fk foreign key (id_cat_code) references category (cat_bus_cod
e))

https://www.youtube.com/watch?v=pRLnU0lWEXk
table no 4:

1 create table warehouse


2 (wh_code varchar2(10),
3 wh_name varchar2(30),
4* constraint warehouse_pk primary key(wh_code))

table no 5:

table no 6:
1 create table vendor_setup
2 (vs_code varchar2(10),
3 vs_name varchar2(30),
4* constraint vs_pk primary key (vn_code))

table no 7;

create table purchase_master


(pm_bill varchar2(10),
pm_item_name varchar2(20),
pm_ven_c varchar2(10),
pm_wh_c varchar2(10),
pm_date date,
constraint pm_pk primary key (pm_bill),
constraint pm_fk foreign key(pm_item_name) references item_setup(is_code),
constraint pm_fk2 foreign key(pm_ven_c) references vendor_setup(vs_code),
constraint pm_fk3 foreign key(pm_wh_c) references warehouse_setup(wh_code))

table no 8:

create table purchase_detail


(pd_bill varchar2(10),
pd_item_code varchar2(20),
pd_qty number(10),
pd_rate number(10),
pd_amount number(10),
constraint pd_fk foreign key(pd_bill) references purchase_master(pm_bill),
constraint pd_fk2 foreign key(pd_item_code)references item_setup(is_code))

table no 9:
create table purchase_return_master
(prm_bill varchar2(10),
prm_item_name varchar2(20),
prm_ven_c varchar2(10),
prm_wh_c varchar2(10),
prm_date date,
constraint prm_pk primary key (prm_bill),
constraint prm_fk foreign key(prm_item_name) references item_setup(is_code),
constraint prm_fk2 foreign key(prm_ven_c) references vendor_setup(vs_code),
constraint prm_fk3 foreign key(prm_wh_c) references warehouse_setup(wh_code))

table no 10:

create table purchase_return_detail


(prd_bill varchar2(10),
prd_item_code varchar2(20),
prd_qty number(10),
prd_rate number(10),
prd_amount number(10),
constraint prd_fk foreign key(prd_bill) references purchase_return_master(prm_b
ill),
constraint prd_fk2 foreign key(prd_item_code)references item_setup(is_code))

table no 11:
create table sale_return_master
(srm_bill varchar2(10),
srm_item_name varchar2(20),
srm_cus_c varchar2(10),
srm_wh_c varchar2(10),
srm_date date,
constraint srm_pk primary key (srm_bill),
constraint srm_fk foreign key(srm_item_name) references item_setup(is_code),
constraint srm_fk2 foreign key(srm_cus_c) references vendor_setup(vs_code),
constraint srm_fk3 foreign key(srm_wh_c) references warehouse_setup(wh_code))