Вы находитесь на странице: 1из 7

Data Base Design

Introduction :

 Database : A Database is collection of related data, which can be of any size


and complexity. By using the concept of Database, we can easily store and
retrieve the data. The major purpose of a database is to provide the
information, which utilizes it with the information’s that the system needs
according to its own requirements.

 Database Design : Database design is done before building it to meet


needs of end-users within a given information-system that the database is
intended to support. The database design defines the needed data and data
structures that such a database comprises

The database is physically implemented using MySQL.

The database for E-Bill is organized into 9 tables:

 account
 admin
 billing
 customer
 electricityboard
 feedback
 invoice
 tariff

Each entity can be described as follows along with its attributes:

1. Database tables:

Table name: customer


Field name Type Index Description
cust_id int(10) Primary key Customer ID
cust_name varchar(50 Not null Customer name
)
account_type varchar(25 Not null Account type
)
address text Not null Customer address
state varchar(25 Not null State
)
city varchar(50 Not null City
)
pincode varchar(10 Not null PIN Code
)
email_id varchar(25 Not null Customer Email ID
)
password varchar(25 Not null Customer password
)
status varchar(10 Not null Customer status
)

Table name: account


Field name Type Index Description
account_id int(10) Primary key Account ID
cust_id int(10) Foreign key Customer ID from customer table
account_no varchar(25) Foreign key Electricity Account number
electricityboard_i int(10) Not null Electricity board id from electricity table
d
name varchar(50) Not null Account holder name
address text Not null Account holder billing address
rr_number varchar(25) Not null Account RR number
status varchar(10) Not null Account status

Table name: admin


Field name Type Index Description
admin_id int(10) Primary key Admin ID
admin_name varchar(25 Not null Administrator name
)
login_id varchar(25 Not null Admin login ID
)
password varchar(25 Not null Admin password
)
admin_type varchar(20 Not null Login type – Admin or Employee
)
status varchar(10 Not null Admin status
)

Table name: billing


Field name Type Index Description
bill_no int(10) Primary key Bill number
cust_id int(10) Foreign key Customer ID from customer table
account_id int(10) Foreign key Account ID from account table
payment_mode varchar(25) Not null Payment mode from billing table
payment_date date Not null Bill amount Paid date
payment_time time Not null Bill amount Paid time
rr_number varchar(25) Not null RR number from billing table
bill_amount float(10,2) Not null Total bill amount
paid_amount float(10,2) Not null Total paid amount
excess_paid float(10,2) Not null Excess paid amount
status varchar(10) Not null Billing payment status

Table name: electricityboard


Field name Type Index Description
electricityboard_i int(10) Primary key Electricity board ID
d
electricityboard varchar(25) Not null Electricity board
logo varchar(100) Not null Electricity board logo
note text Not null Any additional Note
status varchar(10) Not null Status

Table name: feedback


Field name Type Index Description
feedback_id int(10) Primary key Feedback ID
cust_id int(10) Foreign key Customer ID from customer table
feedback text Not null Feedback details
feedback_date date Not null Feedback date
status varchar(10) Not null Feedback status

Table name: invoice


Field name Type Index Description
invoice_id int(10) Primary key Invoice ID
electricityboard_id int(10) Foreign key Electricity board ID from electricity
board table
account_no varchar(25 Foreign key Account Number from account table
)
tariff_id int(10) Foreign key Tariff ID from tariff table
readingdate date Not null Electricity meter reading date
bill_no varchar(25 Not null Receipt bill number
)
present_reading float(10,2) Not null Present reading detail
previous_reading float(10,2) Not null Previous reading detail
consumption_unit float(10,2) Not null Consumption unit detail
fixed_charge float(10,2) Not null Minimum fixed charge
energry_charge float(10,2) Not null Energy charge
tax float(10,2) Not null Tax amount in total
bill_amount float(10,2) Not null Total bill amount
interest float(10,2) Not null Interest in percentage
previous_balance float(10,2) Not null Previous balance amount
interest_pre_balanc float(10,2) Not null Previous interest balance amount
e
others float(10,2) Not null Other charges
credit float(10,2) Not null Credit amount
consession float(10,2) Not null Any concession
net_amount float(10,2) Not null Grand total
due_date date Not null Last date of bill payment
status varchar(10 Not null Invoice status
)
Table name: tariff
Field name Type Index Description
tariff_id int(10) Primary key Tariff ID
tariff_type varchar(50 Not null Tariff types
)
tariff_discription text Not null Tariff description
status varchar(10 Not null Tariff status
)

2. Entity-Relationship Diagram:

An entity-relationship (ER) diagram is a specialized graphic that illustrates the


relationships between entities in a database. ER diagrams often use symbols to
represent three different types of information. Boxes are commonly used to represent
entities. Diamonds are normally used to represent relationships and ovals are used to
represent attributes.

The Symbols are shown in below table:

Name Notation Description

Entity is represented by a
box within the ERD. Entities
Entity are abstract concepts, each
representing one or more
instances of the concept in
question. An entity might be
considered a container that
holds all of the instances of a
particular thing in a system.
Entities are equivalent to
database tables in a
relational database, with
each row of the table
representing an instance of
that entity.

Relationships are
represented by Diamonds. A
Relationship relationship is a named
collection or association
between entities or used to
relate to two or more
entities with some common
attributes or meaningful
interaction between the
objects.

Attributes are represented


by Oval. An attribute is a
Attributes single data item related to a
database object. The
database schema associates
one or more attributes with
each database entity.

ER Diagram:
tariff__type
admin_name login_id
password tariff
admin_type tariff_id discription
admin_id

ADDS tariff
admin

note
electricityboard_id electricityboard

DEPENDS
CREATES electricityboard ON

invoice_id bill_no tax


cust_id cust_name address rr_number RECEIVES
account_id name

invoice
customer ADDS account GENERATES

PUBLISH
PAYS CHECKS

feedback_
feedback_id feedback
date
bill_no payment_date payment_time

feedback

billing

Database Schema design:


MySQL Workbench simplifies database design and maintenance, automates
time-consuming and error-prone tasks, and improves communication among DBA and
developer teams. It enables data architects to visualize requirements, communicate
with stakeholders, and resolve design issues before a major investment of time and
resources is made. It enables model-driven database design, which is the most efficient
methodology for creating valid and well-performing databases, while providing the
flexibility to respond to evolving business requirements. Model and Schema Validation
utilities enforce best practice standards for data modeling, also enforce MySQL-specific
physical design standards so no mistakes are made when building new ER diagrams or
generating physical MySQL databases.

Вам также может понравиться