Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
31 views

Relational Database Management System Lab - Assignment2

1. The document provides instructions to create tables and insert sample data for tracking sales orders and details in a relational database. 2. Tables are to be created for sales managers, sales orders, and order details with specified columns and constraints. 3. Sample data is provided to insert into the tables for testing including sales managers, orders, and order line items.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Relational Database Management System Lab - Assignment2

1. The document provides instructions to create tables and insert sample data for tracking sales orders and details in a relational database. 2. Tables are to be created for sales managers, sales orders, and order details with specified columns and constraints. 3. Sample data is provided to insert into the tables for testing including sales managers, orders, and order line items.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Relational Database Management System Lab(MCAN192)

Assignment2
1. Add primary key to client_master and product_master table

2. Create the following tables:


i. Sales_master
Columnname Datatype Size Attributes
Salesman_no varchar2 6 Primary key/first letter
must start with ‘s’
Sal_name varchar2 20 Not null
Address varchar2 Not null
City varchar2 20
State varchar2 20
Pincode Number 6
Sal_amt Number 8,2 Not null, cannot be 0
Tgt_to_get Number 6,2 Not null, cannot be 0
Ytd_sales Number 6,2 Not null, cannot be 0
Remarks Varchar2 30

ii. Sales_order
Columnname Datatype Size Attributes
S_order_no varchar2 6 Primary/first letter must be 0
S_order_date Date 6 Primary key reference clientno
of client_master table
Client_no Varchar2 25
Dely_add Varchar2 6
Salesman_no Varchar2 6 Foreign key references
salesman_no of
salesman_master table
Dely_type Char 1 Delivery part(p)/full(f),default f
Billed_yn Char 1
Dely_date Date Cannot be less than
s_order_date
Order_status Varchar2 10 Values (‘in
process’;’fulfilled’;back
order’;’canceled)

iii.Sales_order_details
Column Datatype Size Attributes

S_order_no Varchar2 6 Primary key/foreign


key references
s_order_no of
sales_order
Product_no Varchar2 6 Primary key/foreign
key references
product_no of
product_master
Qty_order Number 8
Qty_disp Number 8
Product_rate Number 10,2

Insert the following data into their respective tables using insert statement:

Data for sales_man master table

Salesman_ Salesman Address City Pin State Salamt Tgt_to_get Ytd Rem
no name code Sales
s00001 Kiran A/14 Bom 400002 Mah 3000 100 50 Goo
worli bay
s00002 Manish 65,narim Bom 400001 Mah 3000 200 100 Goo
an bay
s00003 Ravi P-7 Bom 400032 Mah 3000 200 100 Goo
Bandra bay
s00004 Ashish A/5 Bom 400044 Mah 3500 200 150 Goo
Juhu bay

Data for salesorder table:


S_orderno S_orderdate Client no Dely Bill Salesman no Delay Orderstatus
type yn date
019001 12-jan-96 0001 F N 50001 20-jan- Ip
96
019002 25-jan-96 0002 P N 50002 27-jan- C
96
016865 18-feb-96 0003 F Y 500003 20-feb- F
96
019003 03-apr-96 0001 F Y 500001 07-apr- F
96
046866 20-may-96 0004 P N 500002 22- C
may-96
010008 24-may-96 0005 F N 500004 26- Ip
may-96
Data for sales_order_details table:

S_order no Product no Qty ordered Qty disp Product_rate


019001 P00001 4 4 525
019001 P07965 2 1 8400
019001 P07885 2 1 5250
019002 P00001 10 0 525
046865 P07868 3 3 3150
046865 P07885 10 10 5250
019003 P00001 4 4 1050
019003 P03453 2 2 1050
046866 P06734 1 1 12000
046866 P07965 1 0 8400
010008 P07975 1 0 1050
010008 P00001 10 5 525

You might also like