Fashion Conn
Fashion Conn
Fashion Conn
SHOW USER
SELECT TABLE_NAME FROM TABS;
------------------------------------[1]
DROP TABLE USER;
DESC DEPARTMENTS;
------------------------------------[3]
DESC EMPLOYEES;
---------------
------------------------------------[4]
SUPPLIER
-------------------------------------[5]
CREATE TABLE PURCHASE_MASTER
(
BILL_NO NUMBER(30) CONSTRAINT PURCHASE_MASTER_BILL_NO_PK PRIMARY KEY,
---- PK AUTO GEN NUMBER.
SUPPLIER_ID NUMBER(10), ---- FK
PURCHAS_DATE DATE,
DISCOUNT_PCT NUMBER(11,2),
DISCOUNT_AMOUNT NUMBER(11,2),
TOTAL_AMOUNT NUMBER(11,2),
VAT_PCT NUMBER(11,2),
VAT_AMOUNT NUMBER(11,2),
TRANSPORTATION NUMBER(11,2),
NET_AMOUNT NUMBER(11,2),
PAID NUMBER(11,2),
DUE NUMBER(11,2),
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
-------------------
ALTER TABLE PURCHASE_MASTER
ADD CONSTRAINT PURCHASE_MASTER_SUPPLIER_ID_FK FOREIGN KEY REFERENCES
SUPPLIER(SUPPLIER_ID);
------------------------------------[6]
CREATE TABLE PURCHASE_DETAILS
(
ID NUMBER(10) CONSTRAINT PURCHASE_DETAILS_ID_PK PRIMARY KEY, ----
PK
BILL_NO NUMBER(30), ----FK.
PRODUCT_ID NUMBER(10), ----FK
QTY NUMBER(10),
BUYING_PRICE NUMBER(11,2),
QTY NUMBER(10),
AMOUNT NUMBER(11,2),
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
----------------------------
ALTER TABLE PURCHASE_DETAILS
ADD CONSTRAINT PURCHASE_DETAILS_BILL_NO_FK FOREIGN KEY REFERENCES
PURCHASE_MASTER(BILL_NO);
------------------------------------[7]
------------------------------------[8]
------------------------------------[10]
------------------------------------[11]
---------------
------------------------------------[12]
PRODUCT SPECIFICATIONS-----------
ID NUMBER(10)
COLOUR VARCHAR2(50)
FABRIC VARCHAR2(50), ---SILK,COTTON,LILLEN
VALUE ADDITION VARCHAR2(100), ---Embroidery,MIRROR WORK,SCREENPRINT
------------------------------------[12]
CREATE TABLE PRODUCT
(
IMAGE BLOB,
PRODUCT _ID NUMBER(10) CONSTRAINT PRODUCT_PRODUCT_ID_PK PRIMARY KEY,(PK)
CATEGORY_ID NUMBER(10),---------(FK)
BRAND_ID NUMBER(10),-----(FK)
UNIT_TYPE_ID NUMBER(10),----(FK)
SIZE_ID NUMBER(10),-----(FK)
PRODUCT_NAME VARCHAR2(50),
PRODUCT_TYPE VARCHAR2(100), ----CLOTHING DRESS,BAG,SHOES,WATCH
STOCK_QTY NUMBER(10),
BUYING_PRICE NUMBER(11,2),
SELLING_PRICE NUMBER(11,2),
PRODUCT_DESC(FK) VARCHAR2(100),
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
---------------
ALTER TABLE PRODUCT
ADD CONSTRAINT PRODUCT_CATEGORY_ID_FK FOREIGN KEY REFERENCES
PRODUCT_CATEGORIES(CATEGORY_ID);
------------------------------------[13]
------------------------------------[14]
CREATE TABLE SALES_MASTER
(
INVOICE_NO NUMBER(30) CONSTRAINT SALES_MASTER_INVOICE_NO_PK PRIMARY KEY,----
PK.
INVOICE_DATE DATE,
CUSTOMER_ID NUMBER(10), ---- FK
DISCOUNT_PCT NUMBER(11,2),
DISCOUNT_AMOUNT NUMBER(11,2),
TOTAL_AMOUNT NUMBER(11,2) DEFAULT 0,
VAT_PCT NUMBER(11,2),
VAT_AMOUNT NUMBER(11,2),
NET_AMOUNT NUMBER(11,2),
PAID NUMBER(11,2) DEFAULT 0,
DUE NUMBER(11,2) DEFAULT 0,
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
---------
ALTER TABLE SALES_MASTER
ADD CONSTRAINT SALES_MASTER_CUSTOMER_ID_FK FOREIGN KEY REFERENCES
CUSTOMER(CUSTOMER_ID);
------------------------------------[15]
CREATE TABLE SALES_DETAILS
(
ID NUMBER(10)CONSTRAINT SALES_DETAILS_ID_PK PRIMARY KEY,(PK)
INVOICE _NO NUMBER(30),-------FK
PRODUCT_ID NUMBER(10),-------FK
SELLING _PRICE NUMBER(11,2),
QTY NUMBER(10),
AMOUNT NUMBER(11,2)
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
-----------------
ALTER TABLE SALES_DETAILS
ADD CONSTRAINT SALES_DETAILS_INVOICE _NO_FK FOREIGN KEY REFERENCES SALES
MASTER(CINVOICE _NO);
------------------------------------[16]
CREATE TABLE EXPENSE_ITEMS
(
EXPENSE_ITEM_ID NUMBER(10) CONSTRAINT EXPENSE_ITEMS_ID_PK PRIMARY KEY, -----
PK
EXPENSE_ITEM _NAME VARCHAR2(100), ----- RENT, DAILY TEA, STATIONARY
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
---------------
------------------------------------[17]
CREATE TABLE EXPENSE
(
ID NUMBER(10) CONSTRAINT EXPENSE_ID_PK PRIMARY KEY, ----- PK
EXPENSE_ITEM_ID NUMBER(10), ----- FK
EXPENSE_DATE DATE,
QTY NUMBER(10),
AMOUNT NUMBER(11,2),
ENTRY_BY VARCHAR2(100) DEFAULT USER,
ENTRY_DATE DATE,
UPDATE_BY VARCHAR2(100) DEFAULT USER,
UPDATE_DATE DATE
);
);
------------------------------------[19]
CREATE TABLE STOCK
(
-------------------