0% found this document useful (0 votes)
12 views

Experiment 1

Related to RDBMS
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Experiment 1

Related to RDBMS
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

EXPERIMENT-1

EXPERIMENT-1

Aim: Create a database for the stock holders of any product.

(A)Create a table for the client information.

1) Table name:-client_master01

create table client_master01( client_no varchar(6)primary ky check(client_no


like 'c%'), name varchar(20)not null, address1 varchr(30), address2 varchar(30),
city varchar(15), state varchar(15), pincode int(6), bal_amt double(10,2));

OUTPUT:-

Create a database for the stock holders of any product.Page 1


EXPERIMENT-1

(B) Create a table for Product Information

2) Table name:-product_master01

create table product_master01( product_no vachar(6) primary key


check(product_no like 'p%'), description varchar(15) not null, profit_percent
double(4,2) not null, unit_measure varchar(10), qty_on_hand int(8) not null,
reorder_lvl int(8) not null, sell_price double(8,2) not null check(sell_price > 0),
cost_price double(8,2) not nll check(cost_price > 0));

OUTPUT:-

Create a database for the stock holders of any product.Page 2


EXPERIMENT-1

(C) Create a table for salesman information.


3) Table name:- salesman_master01

create table salesman_master01( salesman_no varchar(6) primary key


check(salesman_no like 's%'), salesman_name varchar(20) not null, address1
varchar(30) not null, address2 varchar(30), city varchar(15), pincode int(8),
state varchar(15), sal_amt double(8,2) not null check(sal_amt>0), tgt_to_get
double(6,2) not null check(tgt_to_get>0),ytd_sales double(6,2) not null, remark
varchar(60));

OUTPUT:-

Create a database for the stock holders of any product.Page 3


EXPERIMENT-1

(D)Create a table for the record of sales order information.


4) Table name:- sales_order01

create table sales_order01(order_no varchar(6) primary key check(order_no like


'O%'),order_date date,client_no varchar(6),dely_addr varchar(25),salesman_no
varchar(6),dely_type char(1) default'F' check(dely_type in('P','F')),billed_yn
char(1),dely_date date,check(dely_date>order_date),order_status varchar(10)
check(order_status in('in process','fulfilled','backorder','cancelled')),foreign key
(salesman_no) references salesman_master01,foreign key (client_no) references
client_master01);

OUTPUT:-

Create a database for the stock holders of any product.Page 4


EXPERIMENT-1

(E) Create a table for the sales order details.


5) Table name:- sales_order_details01

create table sales_order_details01


(order_no varchar2(6) references sales_order01,
product_no varchar2(6)references product_master01 ,
qty_ordered number(8),
qty_disp number(8),
product_rate nmber(10,2),
primary key(order_no,product_no));

OUTPUT:-

Create a database for the stock holders of any product.Page 5


EXPERIMENT-1

(F) Create table for the challan information.


6) Table name:- challan_header01

create table challan_header01


(challan_no varchar2(6) primary key check(challan_no like'CH%'),
s_order_no varchar2(6)refrences sales_order01 ,
challan_date date not null,
billed_yn char(1) default'N' check(billed_yn in('Y','N')));

OUTPUT:-

Create a database for the stock holders of any product.Page 6


EXPERIMENT-1

(G) Create a table for the reference of the other table through challan
header information.
7) Table name:- challan_header101

create table challan_header101


(challan_no varchar2(6) refernces challan_header01,
product_no varchar2(6)referenes product_master01 ,
qty_disp number(4,2) not null);

OUTPUT:-

Create a database for the stock holders of any product.Page 7

You might also like