Sie sind auf Seite 1von 7

ORDER FORM

Order No:

Order Date:

Cust. ID:
Cust. Name:
Cust. Address:
Cust. Contact No:

Suppl. ID:
Suppl. Name:
Suppl. address:
Suppl. Contact No:

Item
No.

Item Name Rate Per Unit

Quantity

Total Amount

Amount

Step 1

Put All the fields in one table

Order No:
Order Date:
Cust. Id
Cust. Name
Cust. Address
Cust. Contact No.
Suppl. ID
Suppl. Name
Suppl. Address
Suppl. Contact No.
Item No.
Item Name
Rate Per Unit
Quantity
Amount
Total Amount

Step2 1NF
Split the tables in repeating and non repeating
fields.
(T1)
Order No
Order Date
Cust. Id
Cust. Name
Cust. Address
Cust. Contact No.
Suppl. ID
Suppl. Name
Suppl. Address
Suppl. Contact No.

(T2)
Order No
Item No.
Item Name
Rate Per Unit
Quantity

Step 3 2NF
Remove partial dependency
(T1) - Order
Order No
Order Date
Cust. Id
Cust. Name
Cust. Address
Cust. Contact No.
Suppl. ID
Suppl. Name
Suppl. Address
Suppl. Contact No.

(T2)- Order Details


Order No
Item No.
Quantity

(T3) - Item
Item No.
Item Name
Rate Per Unit

Step 4 3NF
Removing Transitive dependency
(T3) - Item
(T1) - Order
Order No
Order Date
Cust. Id
Suppl. ID

Item No.
Item Name
Rate Per Unit

(T2)- Order Details (T4)- Supplier


Order No
Item No.
Quantity

Suppl. Id
Suppl. Name
Suppl. Address
Suppl. Contact No.

(T5) - Customer
Cust. Id
Cust. Name
Cust. Address
Cust. Contact No.

Table Creation
Tables for Order Form Case
Create table Customer (
Customer_No Number(4) Primary Key,
C_Name Varchar2(30) Not Null,
C_Address Varchar2(15),
C_Contact_No Varchar2(10));
Create table Supplier (
Supplier_No Number(4) Primary Key,
S_Name Varchar2(30) Not Null,
S_Address Varchar2(15),
S_Contact_No Varchar2(10));
Create table Item (
Item_No Number(4) Primary Key,
I_Name Varchar2(30) Not Null,
Rate_Per_Unit Number(10,2));

Create table Order (


Order_No Number(4) Primary Key,
Order_date date Not NULL,
Cust_Id Number(4) references customer(cust_id),
Suppl_id Number(4) references supplier (suppl_id));

Create table OrderDetails (


Order_No Number(4) references order(Order_No),
Item_No Number(4) references Item(Item_No),
Quantity Number(10),
Primary key(Order_No,Item_No));

Das könnte Ihnen auch gefallen