Voter Management System Report - Tejas Agarwal

16
1 | Page IS 631 101 Enterprise Database Management Project on VOTER MANAGEMENT SYSTEM Project by:- Tejas Omprakash Agarwal Date: 13 th December 2013

description

Voter Management System project is a web based application which is used to store, maintain and analyse the information of voters. Scope:  To maintain (ADD, EDIT, DELETE) data of the voters  Track voters voting records  Sort voters by Surname, Building Name  Select and Print records  Find Duplicate records using voter name  Sort voter whose voter based on year of voting  Search voter from the records Technologies Used: Database: MySQL Front-end: EXTJS 4.0, HTML, CSS, and JavaScript

Transcript of Voter Management System Report - Tejas Agarwal

Page 1: Voter Management System Report - Tejas Agarwal

1 | P a g e

IS 631 101 – Enterprise Database Management

Project on

VOTER MANAGEMENT SYSTEM

Project by:-

Tejas Omprakash Agarwal

Date: 13th

December 2013

Page 2: Voter Management System Report - Tejas Agarwal

2 | P a g e

CONTENTS

Page No.

INTRODUCTION 3

BUSINESS RULES 4

ENTITIES 5

INITIAL ER DIAGRAM 7

FINAL EER DIAGRAM 8

DATA DICTIONARY 9

QUERIES 10

SCREEN SHOTS OF SYSTEM 13

Page 3: Voter Management System Report - Tejas Agarwal

3 | P a g e

INTRODUCTION

Voter Management System project is a web based application which is used to store,

maintain and analyse the information of voters.

Scope:

To maintain (ADD, EDIT, DELETE) data of the voters

Track voters voting records

Sort voters by Surname, Building Name

Select and Print records

Find Duplicate records using voter name

Sort voter whose voter based on year of voting

Search voter from the records

Technologies Used:

Database: MySQL

Front-end: EXTJS 4.0, HTML, CSS, and JavaScript

Page 4: Voter Management System Report - Tejas Agarwal

4 | P a g e

BUSINESS RULES

Voter Personnel Details

Address of Voters

Election Type & Details

Add details of Voters

Edit details of Voters

Delete details of Voters

Print & Preview details of Voters

Find Duplicate entries of Voter

Sort Voter Building wise

Sort Voter Last Name wise

List of polling station

List all the voter who casted their vote in a particular election.

THESE THINGS ARE RELATED AS FOLLOWS:-

Voter is associated with one address and one address can be assigned to many voters

Election can have many voters and voters can vote in many election

Voter is only assigned to one polling station whereas polling station can have many

voters

Page 5: Voter Management System Report - Tejas Agarwal

5 | P a g e

ENTITIES

E1. voter_details

voter_details

PK voter_id

voter_name voter_gender voter_age address_id polling_id email voting_status election_id

E2. voter_address

E3. polling_station

polling_station

PK polling_id

polling_name election_id polling_pincode

Page 6: Voter Management System Report - Tejas Agarwal

6 | P a g e

E4. Election

E5. election_type

Page 7: Voter Management System Report - Tejas Agarwal

7 | P a g e

INITIAL ER DIAGRAM

Page 8: Voter Management System Report - Tejas Agarwal

8 | P a g e

FINAL EER DIAGRAM

Page 9: Voter Management System Report - Tejas Agarwal

9 | P a g e

DATA DICTIONARY

Table/Entity Name Attribute Name Type Description Key

voter_details

voter_id int(144) Voter Id Primary Key

voter_name varchar(144) Voter Name (Last name followed by First Name)

voter_gender text Gender

voter_age int(24) Age

email varchar(144) Email Address

address_id int(144) Address Id of Voter Foreign Key 1

polling_id int(144) Polling station Id Foreign Key 2

voting_status varchar(144) Voting Status of voter for that year

election_id int(144) Election Id corresponding to the election Foreign Key 3

voter_address

address_id int(144) Address Id of Voter Primary Key

address_house_no varchar(144) House/shop number

address_bldg_name varchar(144) House Name

address_street varchar(144) Street Name

address_pincode int(144) Pincode

address_state varchar(144) State

address_country varchar(144) Country

polling_station

polling_id int(144) Polling Station ID Primary Key

polling_name varchar(144) Polling Station Name

polling_pincode int(144) Polling Station Pincode

election_id int(144) Election Id corresponding to the election Foreign Key

election

election_id int(144) Election ID Primary Key

election_name varchar(144) Election Name

election_year int(144) Election Year

election_type election_id int(144)

Election Id corresponding to the election

Primary/Foreign Key 1

voter_id int(144) Voter Id corresponding to the voter_details

Primary/Foreign Key 2

Page 10: Voter Management System Report - Tejas Agarwal

10 | P a g e

QUERIES

Display Records Building-wise

Query 1 and 2 are used to select distinct building and display voters belonging to that

building.

Query1:

SELECT DISTINCT address_bldg_name AS voter_building FROM voter_address

Query2:

SELECT a.voter_id,a.voter_name,a.voter_gender,a.voter_age,a.email,(Select

b.address_house_no from voter_address as b where b.address_id = a.address_id AND

b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%') voter_flatno, (Select

b.address_bldg_name from voter_address as b where b.address_id = a.address_id AND

b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%') voter_building, (Select

b.address_street from voter_address as b where b.address_id = a.address_id AND

b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%') address_street, (Select

b.address_pincode from voter_address as b where b.address_id = a.address_id AND

b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%') address_pincode,

(Select b.address_state from voter_address as b where b.address_id = a.address_id AND

b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%') address_state, (Select

b.address_country from voter_address as b where b.address_id = a.address_id AND

b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%') address_country,

a.address_id,a.polling_id,a.voting_status FROM voter_details as a, voter_address as b

WHERE b.address_bldg_name LIKE '%".$_REQUEST['voter_building']."%' AND

b.address_id = a.address_id

Page 11: Voter Management System Report - Tejas Agarwal

11 | P a g e

Delete Records

Query 3 is used to delete one or multiple records from the table.

Query 3:

DELETE FROM election_type where election_id='1' AND voter_id regexp '".$idstr."‘

Display Duplicate Entries

Query 4 is used to display duplicate entries of the voter by comparing the name and address.

Query 4:

SELECT (Select b.address_house_no from voter_address as b where b.address_id =

a.address_id) voter_flatno,(Select b.address_bldg_name from voter_address as b where

b.address_id = a.address_id) voter_building,(Select b.address_street from voter_address as b

where b.address_id = a.address_id) address_street,(Select b.address_pincode from

voter_address as b where b.address_id = a.address_id) address_pincode,(Select

b.address_state from voter_address as b where b.address_id = a.address_id)

address_state,(Select b.address_country from voter_address as b where b.address_id =

a.address_id) address_country,

a.address_id,a.polling_id,a.voting_status,a.voter_id,a.voter_gender,a.voter_age,a.email,a.vote

r_name, COUNT(*) c FROM voter_details AS a GROUP BY voter_name HAVING c > 1

Show all the records

Query 5 is used to display all the records in one tabular format.

Query 5:

SELECT a.voter_id,a.voter_name,a.voter_gender,a.voter_age,a.email,(Select

b.address_house_no from voter_address as b where b.address_id = a.address_id)

voter_flatno,(Select b.address_bldg_name from voter_address as b where b.address_id =

a.address_id) voter_building,(Select b.address_street from voter_address as b where

b.address_id = a.address_id) address_street,(Select b.address_pincode from voter_address as

b where b.address_id = a.address_id) address_pincode,(Select b.address_state from

voter_address as b where b.address_id = a.address_id) address_state,(Select

b.address_country from voter_address as b where b.address_id = a.address_id)

address_country, a.address_id,a.polling_id,a.voting_status FROM voter_details as a limit

$_REQUEST[start],$_REQUEST[limit]

Page 12: Voter Management System Report - Tejas Agarwal

12 | P a g e

Add records

Query 6 is used to insert data into voter_details table.

Query 6:

INSERT INTO `voter`.`voter_details` (`voter_id`, `voter_name`,`voter_gender`,

`voter_age`,`email`,`election_id`,`polling_id`,`voting_status`) VALUES ('$id', '$f2', '$f5',

'$f6','$f7','1','$pincode_check','$f12');

Print & Preview records

Page 13: Voter Management System Report - Tejas Agarwal

13 | P a g e

SCREEN SHOTS

Screen-shot of complete system.

Screen-shot of Add panel to insert data.

Page 14: Voter Management System Report - Tejas Agarwal

14 | P a g e

Screen-shot of Edit panel to edit data.

Screen-shot to select building and display voters of that building.

Page 15: Voter Management System Report - Tejas Agarwal

15 | P a g e

Screen-shot to select Surname and display voters of that surname.

Page 16: Voter Management System Report - Tejas Agarwal

16 | P a g e

Thank You