Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DATA
INFORMATION
DATABASE
ORGANIZATION AS AN INFORMATION SYSTEM
SOURCES/QUALITIES OF INFO SYSTEM
WHAT IS DATABASE
HIERARCHY OF DATABASE
DATABASE Vs. FILE SYSTEM
DATA MODELS
DATABASE MANAGEMENT SYSTEM
DATABASE DESIGN
DATA
DATA = GREEK WORD DATUM
MEANS
Raw facts and figures
LIKE
Number, event, letter, transaction
By which we cannot make any conclusion
OR
Meaningless
INFORMATION
PROCESSED DATA WHICH IS
MEANINGFULL
User can take the decision based on information
Data
Internal
Processing
OR
Extertnal
Information
Organization as an information
system
Marketing
Sales
management
Planning
Production
Control
Corporate
Database
Accounting
Material
raw
Manufacturing
Scheduling
Production
finished
Sources/Qualities of Information
Internal & External
The value of information
Information for Managers-Controlling,
Operation, Strategic, Tactical.
Completeness
Accurate
Timeliness
Speed
What is DATABASE
Hierarchy of DATABASE
Bit
Byte
Field
Record
Table
Database
0,1
10001101 (8Bits)
Collection of Bytes
Collection of Fields
Collection of Records
Collection of tables
Field
E_no
E_name
E_age E_dept
E_add
E101
Amit
25
Sales
Gurgaon
E102
Sunil
32
Marketing
Delhi
E103
Radha
27
Accounts
Chennai
E104
Vibha
34
Sales
Delhi
E105
Sunita
30
Marketing
Mumbai
E_no
Basic
TA
DA
PF
E101
5000
500
250
1000
E102
7000
700
350
1400
E103
5500
550
225
1100
E104
8000
800
400
1600
Emp_payment E105
7500
750
375
1500
Records
Emp_personnel
Table
Table
D
A
T
A
B
A
S
E
Examples of Database
Organization
Bank
Hospital
University
Government Organization
Manufacturing Company
Why Database
Compactness
Speed
Controlled Redundancy
Inconsistency can be avoided
Database can be shared
Security
Integrity
3. Not Secured
2. Self-describing of a DB
4. Integrity
3. Insulation between
programs and data
4. Support of multiple views
of the data
5.
Data Models
Collection of Conceptual tools for
describing
1.
2.
3.
4.
Data
Data relationships
Constraints
Data semantics
Data Model
Object Oriented Model
1. E-R Model
2. Object oriented
3. Semantic
Physical Model
Relational Model
1. A relational database
allows the definition of
data structures,
storage and retrieval
operations,
integrity constraints.
2. In such a database the
data and relations
between
them are organized in
tables.
3. A table is a collection of
records and each
record in
Network Model
1. Data are
represented as
collection of
records.
2. Relationships
are represented as
Links.
3. Each record is a
collection of fields
which can be
Hierarchical Model
1. A hierarchical database consists
of a collection of records which
are connected to one another
through links.
2. A record is a collection of fields,
each of which contains only
one data value.
3. A link is an association between
precisely two records.
4. The hierarchical model differs
from the network model in that
the records are organized as
collections of trees rather than
as arbitrary graphs.
5. A parent may have an arrow
pointing
to a child, but a child must have
Entity / Attribute
Entity=A person, Place, Thing or Event
Ex: Teacher, Organization, Employee
Ename
Edept
Employee
Eage
Eage
E-R Model
1. Based on perception of
the real world.
2. Collection of basic
object called as entity
3. And relationships
among the entity.
4. Rectangles=entity
5. Ellipses=attributes
6. Diamond=relation
Semantic Model
Include extended relation between tables
Richer facilities for capturing the data
objects
Maintains integrity of the objects
Physical Model
Used to describe data at lowest level
Where and how to store the data
Ex: Unifying Model &
Frame memory Model
Schema Definition
The description of Database is called as
schema.
Specified during database design and
expected to change easily.
Ex: Employee
Emp_ID
Emp_Name
Add
City
pincode
Internal schema
Internal schema = describe the storage
structure of the DB.
Uses physical data model that describe
storage and access path of the data.
Ex: stored item : length 40 bytes
type: number, offset=0, index=1
name: character, offset=6
price: number, offset=20
Conceptual schema
Describe the structure of the DB
Concentrates on describing entities, data
type, relationships, user operation,
constraints.
Represented in the form of data model ex.
E-R model
Database Architecture
ANSISPARC
ThreeLevelArchitecture
Data independence
Capacity to change the schema at one level
of DB system without having to change the
schema at next higher level
Application program
design
Transaction
implementation
Application program
Mini world
Requirement & collection
analysis
Data requirement
Conceptual
design
Conceptual schema
logical
design
logical schema
physical
design
internal schema
Database Design
It is important to design the database in
such a way that:
A specific item can be reached easily
(maximum guarantee that the desired record
will be
reached)
Database languages
DDL=data definition language
Ex: create, alter, drop, grant, revoke
DML=data manipulation language
Ex: Select, update, deletion, insertion
Insertion, modification, deletion and access
TCL=transection control language
Ex: commit, rollback, locktable
VDL=view definition language
Ex: create view
View=window through user can view the database
E-R Modeling
1976 proposed by Peter Chen
ER diagram is widely used in database design
Represent conceptual level of a database system
Describe things and their relationships in high level
Entity
Notations
Notations
Entity
Entity
An entity is an object that exists and is
distinguishable from other objects.
Example: Employee, customer, Student, event,
plant
Notation: rectangle
employee
Entity set
1. An entity set is a set of entities of the same
type that share the same properties.
2. An abstraction of similar things,
3. An entity set contains many entities
e.g. Employee, Customer, students
customer_id
customer_name
Customer_add
Customer_city
Customer_pincode
Employee_id
employee_name
employee_add
employee_city
employee_pincode
Student_id
student_name
student_add
student_city
student_pincode
40
Attributes
Attributes: common properties of the
entities in a entity sets which describe
the entity
Single value attribute: exactly one value
for particular attribute
Ex: age, telephone no.
Multi valued attribute: having sets of
values
Ex: one teacher teaches =multiple
Key attribute
key attribute: has unique value for
each and every entity
Value used to identify the entity
Ex: Emp_No, St_No, Item_no,
customer_no
Candidate key: if one table
Has more then one key attributes
Ex:Vehicle_ID and registration_no
Relationships
Relationship specify the
relations among entities from
two or more entity sets
Cardinality Ratio
The degree of a relationship = the number
of entity sets that participate in the
relationship
1. One to one relationship(1:1)
2. One to many relationships (1:M)
3. Many to one relationship (M:1)
4. Many to many relationship (M:M)
One to Many
One dept = many employees
Dept1
emp1
emp2
emp3
emp4
Many to One
One Teacher = many students
student1
student2
student3
student3
teacher
In the many to One relationship a customer is
associated with loan via borrower,
Many to Many
Many students = Many projects
student1
project1
student2
project2
student3
project3
student4
project4
Relationship type
binary & Turnery Relation type
Relationship type
Ex; teacher-student relation=taught
Emp-Dept
relation=works for
Doctor-patient relation=treatement
Relationship sets
Ex; teacher, employee, students, dept,
doctor patient
Relationship B/W 2 entities called as
binary type relationship
.
.
.
.
.
.
Emp-Dept
E1,E3,E6 works for d1
E2, E4 works for d2
E5 works for d3
r1
r2
r3
r4
r5
r6
.
.
.
.
.
.
d1
d2
d3
d4
d5
d6
.
.
.
.
.
.
Turnery relationship
s1
s2
.
p1
P2
p3
r1
r2
r3
r4
r5
r6
.
.
.
.
.
.
r7 .
j1
j2
j3
j4
j5
j6
.
.
.
.
.
.
Recursive/Constraints
Relationship type
Recursive = An entity participates more
then one relationships
Teacher mother, sister, wife
Constraints = organization has rule that
each emp works only for one project
2 types of relationship constraints
1. Cardinality Ratio
2. Participation
a) Total participation
b) Partial participation
Participation Constraints
Specifies whether the existence of an entity
depend on its being related to another entity
via the relationship type.
2 types
1. Total participation
2. Partial participation
Total Participation
When we require all entities to participate in the
relationship (total participation), we use double
lines to specify
OR
Every emp has to works_for dept, the total set
Every loan has to have
at least one customer
Partial participation
We do not expect every employee to
manage the department so participation of
employee in manages relationship type is
partial
Means that some or part of but not
necessarily all.
Specialization/Generalization
.
.
.
.
.
.
e1
e2
e3
engineer
e1
e2
e3
secretary
e1
e2
e3
technician
Specialization Example
Generalization
1. Generalization reverse process many
entity
having similar type of features.
2. Identify the feature and generalize them in
one
into single super class
Ex; Employee, Car, Truck, person,
employee
University ER Diagram
Degree
Name
StudentID
Birth date
SSN
DName
OfficeNumber
Major In
Department
Student
Sex
DCode
OfficePhone
College
Class
Minor In
Address
City
State
Zip
Offer
CName
Grade_Report
Letter Grade
CourseDesc
Instructor
Year
Course
CNumber
GPA
Credits
Numeric Grade
Section
SectionNumber
Belong_To
Semester