Chapt 02-Lect 05
Chapt 02-Lect 05
)
Database Design: An Architecture for a Database System
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.
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
Create View NED_EMP_VIEW
As
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*/
/* Lets create another view to from multiple tables let say Emp and department table view*/
Database programmer: Proprietary language that is specific to the database system. For example PL/SQL( procedural language
SQL) in oracle , T-SQL(Transact- SQL)
Each of the above Proprietary language language have Data sublanguage(DSL) that is useful for performing operations on 5
database objects. In relational
database theory, the term "sublanguage", purpose by E. F. Codd in 1970, refers to a computer language used to define or
manipulate the structure and contents of a relational database management system (DDL & DML of RDBMS).
In simple words we write normal C ,or c++ program and whenever we requires data then we can use embedded SQL
(DSL) as done above
For END USER language available are Query Languages or Menu driven forms.
1) Tight Coupling : if the host language(programming language) is not distinct from DSL this phenomenon is known as Tight
coupling . Example is PL/SQL & SQL running simultaneously that we create form In oracle or program in oracle using PL/SQL
where side by side we will used SQL (DSL).
2) Loose Coupling: if the host language is clearly separable from DSL. Example is calling SQL data from VB.net.
a) File organization used to store data on physical storage devices & complex low level data structures (Use global lists to
hold all attributes, pointers and address spaces with Garbage-collection Management and unused objects in lists to avoid
memory leaks).
d) Methods of representation of data field (for example for dates or file names).
e) Record Placement.
Conceptual Schema
Internal Schema
OS
Mapping
Database
Physical level
Mapping is correspondence between two levels in three layer architecture & It provides isolation between different levels
Conceptual/Internal Mapping: it basically specifies how the conceptual database records are represented at internal
storage level. If storage structure and access techniques are changed then conceptual internal mapping must be changed
accordingly so that there would be no impact on the conceptual schema and it would remain invariant. (irrespective of file
storage structure and operating system our conceptual database designs always remains the same)
Conceptual Internal Mapping that’s why known as the “KEY OF PHYSICAL DATA INDEPENDENCE”
For example we may generate difference in Record name(view name given to a table), attribute name and the orders of
attribute and we may transform data type by External /Conceptual mapping.
Moreover we may combine several attributes into a single virtual external field. If changes are made in external View or
conceptual model then this Mapping must be changed. External Conceptual Mapping that’s why known as “KEY TO LOGICAL
DATA INDEPENDENCE”
External /External Mapping:
Most DBMS allows an external view to be defined in terms of another view. For example: