Chapt 02-Lect 04
Chapt 02-Lect 04
Chapter 02
Database Design: An Architecture for a Database System
Architecture: Structural design means what are different components in a system and how
these are interconnected with each other.
We have two types of architecture present in Database Management systems:
1)Three level Architecture
2)N- Tier Architecture (Client /Server )
1. Physical Level
2. Conceptual Level
3. External Level
Views
Tables (DDLs)
3
Files/stored structures
4
Mapping is not good for small database, because it takes more time.
The external/conceptual mapping defines the correspondence between a
particular external view and conceptual view. It relates
each external schema with conceptual schema.
The conceptual/internal mapping defines the correspondence between
the conceptual view and the store database. It specifies
how conceptual record and fields are represented at the internal level. It
relates conceptual schema with internal schema.
At lowest level, it is stored in the form of bits with the physical addresses on
the secondary storage device.
At highest level, it can be viewed in the form of files.
The internal schema defines the various stored data types. It uses a physical
data model.
Practical Example: For example a DBMS has selected a specific File organization for the
storage of data on disk, to implement that specific file system the DBMS needs to
create specific indexes. Now whenever the DBMS will attempt to retrieve the data back form the file
organization system it will use the same indexes information for data retrieval. This index information
is one example of additional information which DBMS places in the data when storing it on the disk.
At the same level storage space utilization is performed so that the data can be stored by consuming
minimum space, for this purpose the data compression can be performed, this space optimization is
achieved in such a way that the performance of retrieval and storage process is not compromised.
2. Conceptual Level
7
Conceptual level describes the structure of the whole database for a group
of users.
It is also called as the data model.
Conceptual schema is a representation of the entire content of the database.
These schema contains all the information to build relevant external records.
It hides the internal details of physical storage.
There will be precisely one conceptual view of a database. Conceptual view
consist of occurrences of particular record (row) of all tables.
Dept Emp
DE
);
LOC VARCHAR2(20)
/*VARCHAR is use to store characters. VARCHAR can store up to 2000 bytes of characters while
VARCHAR2 can store up to 4000 bytes of characters. So two indicates double capacity in
varchar2.*/
3. External Level
External level is related to the data which is viewed by individual end users.
This level includes a no. of user views or external schemas.
This level is closest to the user.
11
External view describes the segment of the database that is required for a
particular user group and hides the rest of the database from that user
group.
Examples are of DOB(stored field) is basically viewed by user as an age or
different views for different users. Lets create a view named as
“NED_EMP_VIEW” which shows name of employee in capital letters with
their age and their annual salary as:
Employee View
EMPNO EMP_NAME AGE ANNUAL_SAL
Select EMPNO,
UPPER(ENAME) AS EMP_NAME,
(SYSDATE-DOB)/365 AS Age,
SAL*12 ANNUAL_SAL
From EMP ;
/* whenever we need to take out record from view then we will run the
query as*/
-----------*-------------------*-----------------------*-----------------
In next lecture we will see further detail of external and internal
level (full topic).
13
-----------*---------------------*----------------------*-------------------