VLB Janakiammal College of Engineering and Technology
VLB Janakiammal College of Engineering and Technology
AND TECHNOLOGY
Course Objectives
• Data collection
• Recording
• Sorting
• Classifying
• Calculating
• Storing & retrieving
• Summarizing
• Communicating
Data Processing modes
• Batch processing:
Transactions are collected in a group & processed
together.
• On-line (interactive) processing:
Transactions are processed as & when they appear.
• Real-time processing:
It is a parallel time relationship with on-going activity &
the information produced is useful in controlling the
current/dynamic activity.
Traditional Method of Storage
• In the traditional approach, we used to store information in flat files which
are maintained by the file system under the operating system’s control.
• Application programs go through the file system to access these flat files
LOSS OF
FLEXIBILITY MULTIPLE FILES
INCONSISTENCY
The Database Technology
• Database
Computer based record-keeping system
Collection of interrelated (persistent) data
Database Management System
• Collection of files that contain related data Managed by
a specialized piece of software known as a Database
Management System (DBMS)
• Data management
• Data definition
• Transaction support
• Concurrency control
• Recovery
• Security & integrity
• Utilities- facilities like data import & export, user
management, backup, performance
analysis, logging & audit, physical storage
control
Advantages of a DBMS
• Data independence
• Reduction in data redundancy
• Better security
• Better flexibility
• Effective data sharing
Users of a DBMS
• Hierarchical Model
• Network Model
• Relational Model
• Object-Oriented
Relational Model Basics
• Data is viewed as existing in two dimensional tables known as
relations
Relational Database
Any database whose logical organization is
based on relational data model.
Keys
• Super key
An attribute, or group of attributes, that is sufficient to distinguish every
tuple in the relation from every other one.
• Candidate key
Each super key is called a candidate key
• Primary key
The candidate key that is chosen to perform the identification task is
called the primary key
• Foreign key
A foreign key is a “copy” of a primary key that has been exported from
one relation into another to represent the existence of a relationship
between them.
Data modeling
Conceptual design
Logical design
• ER modeling :
A graphical technique for understanding and organizing the data
independent of the actual database implementation
• Entity:
Any thing that may have an independent existence and about
which we intend to collect data.
Also known as Entity type.
• Entity instance:
a particular member of the entity type e.g. a particular student
• Attributes:
Properties/characteristics that describe entities
• Relationships:
Associations between entities
Attributes
• Simple attribute:
cannot be divided into simpler components
E.g age of an employee
• Composite attribute:
can be split into components
E.g Date of joining of the employee.
Can be split into day, month and year
Single Vs Multi-valued Attributes
• Single valued :
can take on only a single value for each entity instance
E.g. age of employee. There can be only one value for this
• Multi-valued:
can take many values
E.g. skill set of employee
Stored Vs Derived attribute
• Stored Attribute:
Attribute that need to be stored permanently.
E.g. name of an employee
• Derived Attribute:
Attribute that can be calculated based on other attributes
E.g. : years of service of employee can be calculated from
date of joining and current date
Regular Vs. Weak entity type
• Regular Entity:
Entity that has its own key attribute.
E.g.: Employee, student ,customer, policy holder etc.
• Weak entity:
Entity that depends on other entity for its existence and
doesn’t have key attribute of its own
E.g. : spouse of employee
The spouse data is identified with the help of the employee
id to which it is related
Relationships
• A relationship type between two entity types defines the set of all
associations between these entity types
Example:
If Works-for is the relationship between the employee entity and the
department entity, then Ram works for Comp.sc department,
shyam works –for electrical department ..etc are relationship
instances of the relationship, works-for
Degree of a Relationship
Example
A banking scenario
• Banks have customers.
• Customers are identified by name, custid, phone number and address.
• Customers can have one or more accounts
• Accounts are identified by an account number, account type (savings, current)
and a balance.
• Customers can avail loans.
• Loans are identified by loan id, loan type (car, home, personal)
• and an amount.
• Banks are identified by a name, code and the address of the main office.
• Banks have branches.
• Branches are identified by a branch number, branch name and an address.
• Accounts and loans are related to the banks’ branches.
• Create an ER diagram for a database to represent this application
Note: The solution that follows is just a sample and not the only solution