Que 1

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

QUE. :- 1 CREATE THE FOLLOWING TABLE.

1) ~ TABLE :- CLIENT_MASTER
-------------

COMMAND :- CREATE TABLE CLIENT_MASTER


(
CLIENTNO VARCHAR2(6) PRIMARY KEY,
NAME VARCHAR2(20) NOT NULL,
ADDRESS1 VARCHAR2(30),
ADDRESS2 VARCHAR2(30),
CITY VARCHAR2(15),
PINCODE NUMBER(8),
STATE VARCHAR2(15),
BALDUE NUMBER(10,2)
);

STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
CLIENTNO NOT NULL VARCHAR2(6)
NAME NOT NULL VARCHAR2(20)
ADDRESS1 VARCHAR2(30)
ADDRESS2 VARCHAR2(30)
CITY VARCHAR2(15)
PINCODE NUMBER(8)
STATE VARCHAR2(15)
BALDUE NUMBER(10,2)

2) ~ TABLE :- PRODUCT_MASTER
--------------

COMMAND :- CREATE TABLE PRODUCT_MASTER


(
PRODUCTNO VARCHAR2(6) CHECK(PRODUCTNO LIKE 'P%'),
DESCRIPTION VARCHAR2(15) NOT NULL,
PROFITPERCENT NUMBER(4,2) NOT NULL,
UNITMEASURE VARCHAR2(10) NOT NULL,
QTYONHAND NUMBER(8) NOT NULL,
REORDERLVL NUMBER(8) NOT NULL,
SELLPRICE NUMBER(8,2) NOT NULL,
COSTPRICE NUMBER(8,2) NOT NULL,
PRIMARY KEY(PRODUCTNO)
);

STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
PRODUCTNO NOT NULL VARCHAR2(6)
DESCRIPTION NOT NULL VARCHAR2(15)
PROFITPERCENT NOT NULL NUMBER(4,2)
UNITMEASURE NOT NULL VARCHAR2(10)
QTYONHAND NOT NULL NUMBER(8)
REORDERLVL NOT NULL NUMBER(8)
SELLPRICE NOT NULL NUMBER(8,2)
COSTPRICE NOT NULL NUMBER(8,2)
3) ~ TABLE :- SALESMAN_MASTER
---------------

COMMAND :- CREATE TABLE SALESMAN_MASTER


(
SALESMANNO VARCHAR2(6) CHECK(SALESMANNO LIKE 'S%'),
SALESMANNAME VARCHAR2(20) NOT NULL,
ADDRESS1 VARCHAR2(30) NOT NULL,
ADDRESS2 VARCHAR2(30),
CITY VARCHAR2(20),
PINCODE NUMBER(8),
STATE VARCHAR2(20),
SALAMT NUMBER(8,2) NOT NULL,
TGTTOGET NUMBER(6,2) NOT NULL,
YTDSALES NUMBER(6,2) NOT NULL,
REMARKS VARCHAR2(60),
PRIMARY KEY(SALESMANNO)
);

STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
SALESMANNO NOT NULL VARCHAR2(6)
SALESMANNAME NOT NULL VARCHAR2(20)
ADDRESS1 NOT NULL VARCHAR2(30)
ADDRESS2 VARCHAR2(30)
CITY VARCHAR2(20)
PINCODE NUMBER(8)
STATE VARCHAR2(20)
SALAMT NOT NULL NUMBER(8,2)
TGTTOGET NOT NULL NUMBER(6,2)
YTDSALES NOT NULL NUMBER(6,2)
REMARKS VARCHAR2(60)

4) ~ TABLE :- SALES_ORDER
-----------

COMMAND :- CREATE TABLE SALES_ORDER


(
ORDERNO VARCHAR2(6),
CLIENTNO VARCHAR2(6) REFERENCES CLIENT_MASTER,
ORDERDATE DATE NOT NULL,
DELYADDR VARCHAR2(25),
SALESMANNO VARCHAR2(6) REFERENCES SALESMAN_MASTER,
DELYTYPE CHAR(1) DEFAULT 'F',
BILLYN CHAR(1),
DELYDATE DATE,
ORDERSTATUS VARCHAR2(10),
PRIMARY KEY(ORDERNO)
);

STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
ORDERNO NOT NULL VARCHAR2(6)
CLIENTNO VARCHAR2(6)
ORDERDATE NOT NULL DATE
DELYADDR VARCHAR2(25)
SALESMANNO VARCHAR2(6)
DELYTYPE CHAR(1)
BILLYN CHAR(1)
DELYDATE DATE
ORDERSTATUS VARCHAR2(10)

5) ~ TABLE :- SALES_ORDER_DETAILS
-------------------

COMMAND :- CREATE TABLE SALES_ORDER_DETAILS


(
ORDERNO VARCHAR2(6) REFERENCES SALES_ORDER,
PRODUCTNO VARCHAR2(6) REFERENCES PRODUCT_MASTER,
QTYORDERED NUMBER(8),
QTYDISP NUMBER(8),
PRODUCTRATE NUMBER(10,2)
);

STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
ORDERNO VARCHAR2(6)
PRODUCTNO VARCHAR2(6)
QTYORDERED NUMBER(8)
QTYDISP NUMBER(8)
PRODUCTRATE NUMBER(10,2)

6) ~ TABLE :- CHALLAN_HEADER
--------------

COMMAND :- CREATE TABLE CHALLAN_HEADER


(
CHALLAN_NO VARCHAR2(6) PRIMARY KEY,
CHECK(CHALLAN_NO LIKE 'CH%'),
ORDER_NO VARCHAR2(6) REFERENCES SALES_ORDER,
CHALLAN_DATE DATE NOT NULL,
BILLED_YN CHAR(1) DEFAULT 'N'
);

STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
CHALLAN_NO NOT NULL VARCHAR2(6)
ORDER_NO VARCHAR2(6)
CHALLAN_DATE NOT NULL DATE
BILLED_YN CHAR(1)

7) ~ TABLE :- CHALLAN_DETAILS
---------------

COMMAND :- CREATE TABLE CHALLAN_DETAILS


(
CHALLAN_NO VARCHAR2(6) REFERENCES CHALLAN_HEADER,
PRODUCTNO VARCHAR2(6) REFERENCES PRODUCT_MASTER,
QTY_DISP NUMBER(8) NOT NULL
);
STRUCTURE :-

Name Null? Type


------------------------------- -------- ----
CHALLAN_NO VARCHAR2(6)
PRODUCTNO VARCHAR2(6)
QTY_DISP NOT NULL NUMBER(8)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy