You are on page 1of 19

K.L.E.Societys B.V.

Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

Implementation Phase Report


Title: COMPUTER PHERIPERIALS SALES AND MANAGEMENT

List of Team Members:


USN ROLL NO NAME

2BV10IS019 2BV11IS404 2BV10IS069 2BV10IS094

11 61 29 43

Anup V Shanbhag Chandragouda N C R Kavita Sneha R S

Team Leader: Chandragouda N C

Responsibilities: Anup V Shanbhag Chandragouda N C R Kavitha Sneha R S Creation of GUI and database connectivity. Data Entry And Preparation of the report. Normalization of Relational Schema. Modifying the ER Diagram.

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 1 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

Design updating:

Implementation Phase Questions to be answered Normalization:


1. customer

(CustomerID,FirstName,LastName,Gender,AddrStreet,AddrCity,AddrState,AddrZip,Contact, Email)
The Relation is in 1NF as it has no attributes that can hold only

multiple values. The attributes in the relation can hold only atomic values. The Relation is in 2NF as the primary key contains only one attribute. Hence, every attribute is fully functionally dependent on the key. We observe that there is no transitivity in functional dependencies for the given relation. Hence the relation is in 3NF. Similarly, It is in BCNF as there exists no non-key attribute that determines another non-key attribute. 2. supplier (SupplierID,Name,AddrStreet,AddrCity,AddrState,AddrZip,Contact,Email)

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 2 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING The Relation is in 1NF as it has no attributes that can hold only

multiple values. The attributes in the relation can hold only atomic values. The Relation is in 2NF as the primary key contains only one attribute. Hence, every attribute is fully functionally dependent on the key. We observe that there is no transitivity in functional dependencies for the given relation. Hence the relation is in 3NF. Similarly, It is in BCNF as there exists no non-key attribute that determines another non-key attribute. 3. inventory (ProductID,ItemName,BrandName,Category,SupplierID,Units,PricePerUnit)
The Relation is in 1NF as it has no attributes that can hold only

multiple values. The attributes in the relation can hold only atomic values. The Relation is in 2NF as the primary key contains only one attribute. Hence, every attribute is fully functionally dependent on the key. We observe that there is no transitivity in functional dependencies for the given relation. Hence the relation is in 3NF. Similarly, It is in BCNF as there exists no non-key attribute that determines another non-key attribute. 4. sales(InvoiceID,CustomerID,NetAmount,Date,Status)
The Relation is in 1NF as it has no attributes that can hold only

multiple values. The attributes in the relation can hold only atomic values. The Relation is in 2NF as the primary key contains only one attribute. Hence, every attribute is fully functionally dependent on the key. We observe that there is no transitivity in functional dependencies for the given relation. Hence the relation is in 3NF. Similarly, It is in BCNF as there exists no non-key attribute that determines another non-key attribute. 5. servicereq (RequestID,CustomerID,Type,Description,RegdDate,Token)
The Relation is in 1NF as it has no attributes that can hold only

multiple values. The attributes in the relation can hold only atomic values. The Relation is in 2NF as the primary key contains only one attribute. Hence, every attribute is fully functionally dependent on the key. We observe that there is no transitivity in functional dependencies for the given relation. Hence the relation is in 3NF. Similarly, It is in BCNF as there exists no non-key attribute that determines another non-key attribute.
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 3 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

6. solditems (SerialID,ProductID,InvoiceID,Quantity,TotalPrice)
The Relation is in 1NF as it has no attributes that can hold only

multiple values. The attributes in the relation can hold only atomic values. The Relation is in 2NF as the primary key contains only one attribute. Hence, every attribute is fully functionally dependent on the key. We observe that there is no transitivity in functional dependencies for the given relation. Hence the relation is in 3NF. Similarly, It is in BCNF as there exists no non-key attribute that determines another non-key attribute. Question1: Give the SQL statement(s) used to create the Oracle/MySQL database tables needed to implement the normalized relational schema. Database Creation: CREATE DATABASE itdepot; USE itdepot; Customer: CREATE TABLE IF NOT EXISTS customer ( CustomerID int(11) NOT NULL, FirstName varchar(255) NOT NULL, LastName varchar(255) DEFAULT NULL, Gender varchar(255) NOT NULL, AddrStreet varchar(255) NOT NULL, AddrCity varchar(255) NOT NULL, AddrState varchar(255) NOT NULL, AddrZip int(11) NOT NULL, Contact varchar(11) NOT NULL, Email varchar(255) DEFAULT NULL, PRIMARY KEY (CustomerID), ); Supplier: CREATE TABLE IF NOT EXISTS supplier ( SupplierID int(11) NOT NULL, Name varchar(255) NOT NULL, AddrStreet varchar(255) NOT NULL, AddrCity varchar(255) NOT NULL, AddrState varchar(255) NOT NULL, AddrZip int(11) NOT NULL,
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 4 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

Contact varchar(11) NOT NULL, Email varchar(255) DEFAULT NULL, PRIMARY KEY (SupplierID) ); Inventory: CREATE TABLE IF NOT EXISTS inventory ( ProductID int(11) NOT NULL, ItemName varchar(255) NOT NULL, BrandName varchar(255) DEFAULT NULL, Category varchar(255) NOT NULL, SupplierID int(11) NOT NULL, Units int(11) NOT NULL, PricePerUnit float NOT NULL, PRIMARY KEY (ProductID), FOREIGN KEY (SupplierID) REFERENCES supplier (SupplierID) ON UPDATE CASCADE ); Sales: CREATE TABLE IF NOT EXISTS sales ( InvoiceID int(11) NOT NULL, CustomerID int(11) NOT NULL, NetAmount float NOT NULL, Date date NOT NULL, Status varchar(255) NOT NULL, PRIMARY KEY (InvoiceID), FOREIGN KEY (CustomerID) REFERENCES customer (CustomerID) ON UPDATE CASCADE ); ServiceReq: CREATE TABLE IF NOT EXISTS servicereq ( RequestID int(11) NOT NULL, CustomerID int(11) NOT NULL, Type varchar(255) NOT NULL, Description varchar(255) DEFAULT NULL, RegdDate date NOT NULL, Token date DEFAULT NULL, PRIMARY KEY (RequestID), FOREIGN KEY (CustomerID) REFERENCES customer (CustomerID) ON UPDATE CASCADE ); SoldItems: CREATE TABLE IF NOT EXISTS solditems (
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 5 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

SerialID varchar(255) NOT NULL, ProductID int(11) NOT NULL, InvoiceID int(11) NOT NULL, Quantity int(11) NOT NULL, TotalPrice float NOT NULL, PRIMARY KEY (SerialID), FOREIGN KEY (ProductID) REFERENCES inventory (ProductID) ON UPDATE CASCADE, FOREIGN KEY (InvoiceID) REFERENCES sales (InvoiceID) ON UPDATE CASCADE, );

Question2: Give the actual data stored in each table of the database.
CustomerID 1 FirstName Anup LastName S Gender Male AddrStreet Rajnagar AddrCity Hubli AddrState Karnataka AddrZip 580032 Contact 944944168 4 988070770 6 973822332 9 959171872 6 959129997 9 E-Mail shanbhaganup@gmail.com

Vicky

Male

Ramnagar

Hubli

Karnataka

580029

pulsar.viki@gmail.com

Prateek

Male

Lingraj Nagar Ramesh Bavan Koppikar Road

Hubli

Karnataka

580031

Pratek09@gmail.com

Atreya

Male

Hubli

Karnataka

580029

inspirerjoshi@gmail.com

Ashish

Male

Hubli

Karnataka

580021

ashishb@gmail.com

ProductID 1 2 3 4

ItemName FreeAgent JetFlash350 32 GB VelociRaptor AMD Bulldozer FX 970 GeForce

BrandName Seagate Transcend Western Digital AMD

Category Portable HDD Pen Drive HDD Processor

SupplierID 1 2 3 4

Units 5 10 5 5

PricePerUnit 8500 1100 9500 13500

Nvidia

Graphics Card

6800

SupplierI D 1

Name Seagate

AddrStreet Rajajinagar

AddrCity Bangalor e

AddrStat e Karnatak a

AddrZi p 560031

Contact 0802234656

E-Mail contactus@seagate.com

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 6 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING
2 2 Transcen d Western Digital AMD Brigade Road J C Nagar Bangalor e Bangalor e Bangalor e Bangalor e Karnatak a Karnatak a Karnatak a Karnatak a 560029 0802265346 2 0802234466 2 0802278442 2 0806453120 2

contactus@transcendusa.co m contactus@wdc.com

560018

Koramangal a M G Road

560017

contactus@amd.com

nVidia

560013

contactus@xfx-force.com

RequestID 1 2 3 4 5

CustomerID 1 2 3 4 5

Type Normal Normal Express Normal Express

Description Monitor Flickering OS Formatting Burnt smell from CPU Doesnt Turn On Black And White Video From Monitor

RegdDate 2010-02-04 2011-01-13 2012-01-04 2012-05-05 2012-01-14

Token 2010-02-10 2011-01-26 2012-01-06 2012-05-09 2012-01-20

InvoiceID 1 2 3 4 5

CustomerID 1 2 3 4 5

NetAmount 8500 1100 9500 11000 6800

Date 2012-12-07 2012-09-15 2010-09-15 2010-10-21 2011-01-13

Status Pending Paid Paid Pending Paid

SerialID ASD27654985AJ47

ProductID 1

InvoiceID 1

Quantity 1

TotalPrice 8500

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 7 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

VPKL4876509865 HGJJ56845823JH VFIUH37492347574 KCBDFH8937476

2 3 4 5

2 3 4 5

1 1 1 1

1100 9500 11000 6800

Question3: Give the snapshots, description and SQL queries for each of the user interface forms for your application. (Create the front end using java and hook it up to the SQL using JDBC.) Login Form:

Customer Tab:

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 8 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

SQL Queries:
1. Load Values: SELECT * FROM customer; 2. Add Values: INSERT INTO customer VALUES( custID, firstName, lastName, gender, street, city,
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 9 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING state, zipCode, email, contact); 3. Save Updated Values: UPDATE customer SET FirstName= firstName, LastName= lastName, Gender= gender, AddrStreet= street, AddrCity= city, AddrState= state, AddrZip= zipCode, Contact= contact, Email= email WHERE CustomerID= custID; 4. Search Values:

Case 1: Case 2: Case 3: Case 4:

SELECT * from customer where CustomerID= custID; SELECT * from customer where FirstName= firstName; SELECT * from customer where LastName= lastName; SELECT * from customer where Contact= contact;

5. Remove Values: DELETE FROM customer WHERE CustomerID = custID;

Products Tab:

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 10 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

SQL Queries:
1. Load Values: SELECT * FROM inventory;

2. Add Values:
INSERT INTO inventory VALUES( prodID, prodName,
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 11 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING brandName, category, suplier, units, price);

3. Save Updated Values:


UPDATE inventory SET ItemName= prodName, BrandName= brandName, Category= category, SupplierID= supplier, Units= units, PricePerUnit=price WHERE ProductID= prodID;

4. Search Values

Case 1: SELECT * FROM inventory where ProductID= prodID; Case 2: SELECT * FROM inventory where ItemName= prodName; Case 3: SELECT * FROM inventory where Category= category; 5. Remove Values DELETE FROM inventory WHERE ProductID = prodID;

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 12 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

Supplier Tab:

SQL Queries: 1. Load Values:


SELECT * FROM supplier;

2. Add Values:
INSERT INTO supplier VALUES(supplierID, name, street , city, state,
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 13 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING zip, email, contact); 3. Save Updated Values: UPDATE supplier SET Name= name, AddrStreet= street , AddrCity= city , AddrState= state, AddrZip= zip, Contact= contact, Email= email WHERE SupplierID= supplierID; 4. Search Values:

Case 1: SELECT * FROM supplier where SupplierID= supplierID; Case 2: SELECT * FROM supplier where Name= name; Case 3: SELECT * FROM supplier where Contact= contact; 5. Remove Values: DELETE FROM supplier WHERE SupplierID = supplierID;

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 14 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

Invoice Tab:

SQL Queries: 1. Load Values:


SELECT * FROM inventory;

2. Add Values:
INSERT INTO sales VALUES(invoiceID, CustID, netAmt, Date, Status);
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 15 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

INSERT INTO solditems VALUES(serial, prodID, invID, qty, Price); 3. Save Updated Values: UPDATE sales SET CustomerID= CustID, NetAmount= netAmt, Date= Date, Status= Status WHERE InvoiceID= invoiceID );

4. Search Values:

Case 1: SELECT * FROM sales where InvoiceID= invoiceID; Case 2: SELECT * FROM sales where CustomerID= CustID;

5. Remove Values:
DELETE FROM sales WHERE InvoiceID = invoiceID;

Service Requests Tab:

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 16 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

SQL Queries:

1. Load Values:
SELECT * From servicereq;

2. Add Values:
INSERT INTO servicereq VALUES(requestID, customer, Type, Description, regDate, responseToken);
BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 17 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING 3. Save Updated Values: UPDATE servicereq SET Type= requestID, Description= Description, RegdDate= regDate, Token= responseToken WHERE RequestID= requestID); 4. Search Values:

Case 1: SELECT * FROM servicereq where RequestID= requestID; Case 2: SELECT * FROM servicereq where CustomerID= d _customer; 5. Remove Values: DELETE FROM servicereq WHERE RequestID = requestID;

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 18 of 19

K.L.E.Societys B.V.Bhoomaraddi College of Engineering & Technology, Hubli 580 031 DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

Question4: Give all possible final reports and graphs obtained by your application.

Submission Date: 07-12-2012

BVBCET/ISE/DBMS/ISC304/2012/Course Project/Implementation Phase/Page 19 of 19

You might also like