[go: up one dir, main page]

0% found this document useful (0 votes)
7 views2 pages

Dbmslab 2

The document outlines the creation of four database tables: Client_Master, Product_Master, Salesman_Master, and Sales_Order, each with specific attributes and constraints. Each table includes primary keys, data types, and checks to ensure data integrity, such as specific prefixes for identifiers. The tables are designed to manage client, product, salesman, and sales order information in a structured manner.

Uploaded by

Astuti Kumari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Dbmslab 2

The document outlines the creation of four database tables: Client_Master, Product_Master, Salesman_Master, and Sales_Order, each with specific attributes and constraints. Each table includes primary keys, data types, and checks to ensure data integrity, such as specific prefixes for identifiers. The tables are designed to manage client, product, salesman, and sales order information in a structured manner.

Uploaded by

Astuti Kumari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Create table Client_Master(CLIENTNO Varchar(6) PRIMARY KEY, NAME


Varchar(20) NOT NULL , ADDRESS1 Varchar2(30) ,ADDRESS2 Varchar2(30) ,CITY
Varchar2(15),PINCODE Number(8) , STATE Varchar2(15) ,BALDUE
Number(10,2), Check (SUBSTR(CLIENTNO,1,1)='P') );
desc Client_Master;

2.Create table PRODUCT_MASTER(PRODUCTNO Varchar(6) PRIMARY KEY,


DESCRIPTION Varchar(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
CHECK(SELLPRICE>0) ,COSTPRICE Number(8,2) NOT NULL CHECK
(COSTPRICE>0), Check (SUBSTR(PRODUCTNO,1,1)='P') );
desc PRODUCT_MASTER;

3.Create table SALESMAN_MASTER(SALESMANNO Varchar2(6) PRIMARY KEY,


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 CHECK (SALAMT>0),TGTTOGET
Number(6,2) NOT NULL CHECK (TGTTOGET>0),YTDSALES Number(6,2) NOT
NULL ,REMARKS Varchar2(60), Check (SUBSTR(SALESMANNO,1,1)='S') );
desc SALESMAN_MASTER;
4.Create table SALES_ORDER(ORDERNO Varchar2(6) PRIMARY KEY,CLIENTNO
Varchar2(6) REFERENCES CLIENT_MASTER(CLIENTNO),ORDERDATE Date NOT
NULL,DELYADDR Varchar2(25),SALESMANNO Varchar2(6) REFERENCES
SALESMAN_MASTER(SALESMANNO),DELYTYPE Char(1) DEFAULT 'F' CHECK
(DELYTYPE IN ('P','F')),BILLYN Char(1),CHECK (SUBSTR(ORDERNO,1,1)='O'));
Desc SALES_ORDER;

You might also like