Unit-3 Concept of Database
Unit-3 Concept of Database
1. Physical level:
Physical level is the lowest level of data abstraction.
2 Prepared By : Krishna Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
It tell us how the data is stored in memory.
The access methods like sequential or random access
are used to access data.
It is also known as internal level/ Internal schema.
The internal schema defines the physical storage
structure of the database.
2. Logical level
Logical level contains the information that is actually
stored in the database in the form of tables.
It is also known as conceptual schema.
It defines all database entities, their attributes, and
their relationships.
The programmers generally work at this level because
they are aware of such things about database systems.
3.View level
View level is the Highest level of abstraction. Only a
part of the actual database is viewed by the users.
It hides the unrelated details of the database from
the user.
It also known as External level schema.
This level exists to ease the accessibility of the database
by an individual user.
Multiple views of the same database may exist.
Users can just view the data and interact with the
database, storage and implementation details are
hidden from them.
Database Users:
Database users are the one who really use and take the
benefits of database.
4 Prepared By : Krishna Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
These will be different types of users depending on their need
and way of accessing the database.
DBMS Architecture divided into four parts:
1)DBMS Users
2)Query Processor
3)Storage Processor
4)Disk Storage
b) Application Programmer
Application program are the back end programmer who
writes the code for the application program.
They are the computer professionals,
2)Query Processor
In interprets the requests(Queries) received from end
user via an application program into instructions.
It also executes the user request which is received from
the DML Compiler.
6 Prepared By : Krishna Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Query Processor Container the following Components:
a) DDL Compiler
The DDL Compiler, which converts these
statements to a set of tables.
These tables contains the metadata concerning the
database and are in the form that can be used by
other components of the DBMS.
3) Storage Manager/Processor
Storage manager is a program that provides an interface
between the data stored in the database and the queries
received.
It is also known as database control system.
1-tier Architecture
In this architecture the database is directly available to
the user. it means the user can directly sit on the DBMS
and uses it.
Any changes done here will directly be done on the
database itself. It doesn’t provide a handy tool for end
users.
9 Prepared By : Krishna Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
The 1-tier architecture is used for development of the
local application, where programmers can directly
communicate with the database for the quick response.
Example:
MS Office comes in one tier architecture.
Advantages
1. Easy to implement and optimize performance.
2. Do not have compatibility or Context switching issues.
3. The cost of development is less. E.g. - development and
management cost.
4. Fast for a single user because communication with
another system is not necessary.
Disadvantages
1. Do not support remote/distributed access for data
resources.
2. The cost of the central mainframe is high.
3. Completely unscalable. Only one user can access the
system at a given time via the local client.
11 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Disadvantages
1. It is unscalable when number of users are increase.
2. Less secure because clients are directly interacting with
Database.
Advantages
1. High performance, lightweight
2. Scalability.
3. Improve Data Integrity
12 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
4. Improved Security
5. Easy to maintain and modification is bit easy, won’t affect
other modules
Disadvantages
1. Increase Complexity/ Effort(maintenance)
It is a Client-Server
1 It is a Web-based application.
Architecture.
13 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Hierarchical Model
The Hierarchical model arranges records in hierarchy
like an organizational chart.
Each record type in this model is called a node or
segment.
14 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
A node represents a particular entity.
The top-most node is called root. Each node is a
subordinate of the node that is at the next higher level.
Example: we can represents the shopping websites in the
following way:
15 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Drawback
It is slow complex and more difficult to maintain.
It requires more complex diagram to represent a database
Relational Model
Relational model is the most commonly used database
model.
It is more flexible than hierarchical and network database
models.
The relational model consists of simple relations.
A relation is a term used for table.
A relation represents a particular entity. It is used to store
information about the entity.
The relationships are based on the data of the entities.
16 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Dr E.F Codd Introduced the relational model.
The relationship between entities is represented by the
following diagram :
17 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Components of ER Diagram
1.Entity
It is a thing or object in the real world that is
distiguishable from all other object.
Anything about which we store information is called on
entity.
Entity Set :
It is a set of entities of the some type that share the
some properties or attributes.
An entity set can be represented as rectangles.
Weak Entity
2.Strong Entity Set:
A strong entity set is an entity set that contains
sufficient attributes to uniquely identify all its entities.
Primary key Exists for a strong Entity set.
Single rectangle is used to representing a strong Entity
set.
Strong entity
Strong Entity VS Weak Entity:
Sr
No. Strong Entity Weak Entity
19 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Sr
No. Strong Entity Weak Entity
Strong entity is
Weak entity is represented by a
3. represented by a single
double rectangle.
rectangle.
21 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
22 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
23 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Using Sets, it can be represented as:
Types of Attributes
24 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
i. Simple Attribute
An attribute that can not be further subdivided into
components is a simple attribute.
It is represented by Ellipse
Example : The Roll_no of a student.
25 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
v. Derived Attribute
An attribute that can be from other attribute is known
as derived attribute.
It can be represented by a dashed Ellipse.
Example : A person’s age changes over time and can be
derived from another attribute like date of birth.
26 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Weak Entity The weak entity do
not have a primary
key and are
dependent on the
parent entity.
Relationship Any association
between two entity
types.
Multivalued A Multivalued
Attribute attribute can have
more than one value
that is represented by
double ellipse.
Derived A derived attribute is
Attribute based on another
attribute that is
represented by doted
ellipse.
Key A key attribute can
Attribute uniquely identify an
entity from an entity
set.
27 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Composite A composite attribute
Attribute as an address is
composed of other
attribute such as pin
code, state, country.
Lines
Relationship Association between
one strong and a
weak entity set shown
by using the double
diamond symbol.
Types Of Keys
3.3.1 Super key, candidate key, Primary key, Composite
key, Foreign key, Unique key.
28 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
i. Super Key
A Super Key is a set of one or more attribute that taken
collectively, allow us to identify uniquely an entity in the
Entity Set.
Example : In student table with attribute( S_Rollno,
S_Name, S_Branch, S_Year)
Super key S1->S_Rollno, S_Name
S2->S_Rollno, S_Branch
S3->S_Rollno,S_Year
S4->S_Rollno,S_Name, S_Branch
S5->S_Rollno, S_Branch, S_Year
ii. Candidate Key
The minimal set of attributes that can uniquely identify
a table is known as a candidate key.
Candidate key can be define as the minimum no of
super key that identifies the record uniquely.
It must contain unique values.
Every table must have at least a single candidate key.
29 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Example : In student table with attribute(S_Rollno,
S_Name, S_Branch, S_Year)
Candidate key : C1-> S_Rollno
C2-> S_Rollno, S_name
iii. Primary Key
Primary key can be define as the minimum no of
candidate key that is chosen by the database designer
as the principal means of identifying entities within an
entity set.
It is unique key.
It can identify only one tuple(a record) at a time .
It has no duplicate values. It has unique values.
It can not be NULL.
Primary Keys are not necessarily to be a single
column more than one the column can also be a
primary key for a table.
Example: In student table with attribute(S_Rollno,
S_Name, S_Branch, S_Year)
Primary Key : P1-> S_Rollno
iv. Composite Key
Whenever a primary key consists of more than one
attribute it is known as a composite key.
Example : In student Table with a attribute(S_Rollno,
S_Name, S_Branch, S_Year)
Composite key : S_Rollno, S_id
v. Foreign Key
A foreign key is a column whose value are the same as
the primary key of another table.
It combines two or mote relations(table) at a time.
They act as a cross reference between the tables.
30 Prepared By : Krishna
Mistry
Subject :DATA PROCESSING AND ANALYSIS(105)
Foreign key are the column of the table used to point to
the primary key of another table.
31 Prepared By : Krishna
Mistry