UNIT 1 INTRODUCTION TO DBMS - Nirmala Memorial · PDF fileUNIT 1 INTRODUCTION TO DBMS 7 Levels...

15
UNIT 1 INTRODUCTION TO DBMS 1

Transcript of UNIT 1 INTRODUCTION TO DBMS - Nirmala Memorial · PDF fileUNIT 1 INTRODUCTION TO DBMS 7 Levels...

UNIT 1 INTRODUCTION TO DBMS 1

UNIT 1 INTRODUCTION TO DBMS 2

Example of simple college database which stores student and course information.

Student:

Stud-id Name Subjects Grade

1 Bob CS A 2 Tom MATH B

UNIT 1 INTRODUCTION TO DBMS 3

Example of database catalog.

STUDENT Table

Student_id Name Subjects Class 1 Bob CS 1

20 Tom MATH 2

Column_name Data_type Belongs_to_relation Stud_id Character (4) STUDENT

Name Character (10) STUDENT Subjects Character (20) STUDENT

Class Integer (1) STUDENT

UNIT 1 INTRODUCTION TO DBMS 4

UNIT 1 INTRODUCTION TO DBMS 5

UNIT 1 INTRODUCTION TO DBMS 6

UNIT 1 INTRODUCTION TO DBMS 7

Levels Of Abstraction:-

Process of hiding irrelevant details from user is called data abstraction.

We have three levels of abstraction:

Physical level: This is the lowest level of data abstraction. It describes how data is

actually stored in database. You can get the complex data structure details at this

level.

Logical level: This is the middle level of 3-level data abstraction architecture. It

describes what data is stored in database.

View level: Highest level of data abstraction. This level describes the user

UNIT 1 INTRODUCTION TO DBMS 8

interaction with database system.

Example: Let’s say we are storing customer information in a customer table. At

physical level these records can be described as blocks of storage (bytes,

gigabytes, terabytes etc.) in memory. These details are often hidden from the

programmers.

At the logical level these records can be described as fields and attributes along

with their data types, their relationship among each other can be logically

implemented. The programmers generally work at this level because they are

aware of such things about database systems.

At view level, user just interact with system with the help of GUI and enter the

details at the screen, they are not aware of how the data is stored and what data

is stored; such details are hidden from them.

Data Independence

UNIT 1 INTRODUCTION TO DBMS 9

Logical Data Idependence

Logical data independence indicates that the conceptual schema can be changed without affecting the existing external schemas. The change would be absorbed by the mapping between the external and conceptual levels.

Physical Data Independence

Physical data independence indicates that the physical storage structures or devices could be changed without affecting conceptual schema. The change would be absorbed by the mapping between the conceptual and internal levels.

DBMS Architecture

There are following 3 levels or layers of DBMS Architecture:

1. External level

2. Conceptual level

3. Internal level

UNIT 1 INTRODUCTION TO DBMS 10

EXTERNAL LEVEL

The user’s view of the database.

Consists of a number of different external views of the DB.

Describes part of the DB for particular group of users.

Provides a powerful and flexible security mechanism by hiding parts of the DB from certain

users.

It permits users to access data in a way that is customized to their needs, so that the same

data can be seen by different users in different ways, at the same time.

CONCEPTUAL LEVEL

The logical structure of the entire database as seen by DBA.

What data is stored in the database.

The relationships among the data.

Complete view of the data requirements of the organization, independent of any storage

consideration.

INTERNAL LEVEL

UNIT 1 INTRODUCTION TO DBMS 11

Physical representation of the DB on the computer.

How the data is stored in the database.

- Storage space allocation for data and indexes

- Record description for storage

- Record placement

- Data compression, encryption

DATA MODELS

CLIENT SERVER ARCHITECTURE:

Client-User machine that provides user interface capabilities and local processing

Server- System containing both hardware and software.

-Provides services to the client machines

-Such as file access, printing, or database access

1.Two-Tier Client/Server Architectures:

-Server handles Query and transaction functionality related to SQL processing

Client handles User interface programs and application programs.

2.Three-Tier Client/Server Architecture consists of application server or web

server adds intermediate layer between client and the database server. It Runs

application programs and stores business rules.

3.N-tier Client/Server Architecture divides the layers between the user and the

stored data further into finer components.

Diagram given below:-

UNIT 1 INTRODUCTION TO DBMS 12

Object-based logical models:

-Describe data at the conceptual and view levels.

-Provide fairly flexible structuring capabilities.

-Object-based logical model includes the following.

1.Entity-relationship model.

2.Object-oriented model.

1. The E-R Model

The entity-relationship model is based on a perception of the world as consisting of a collection of basic objects (entities) and relationships among these objects as it's name itself suggests .

An entity is a distinguishable object that exists.

Each entity has associated with it a set of attributes describing it.

E.g. number and balance for an account entity.

A relationship is an association among several entities.

UNIT 1 INTRODUCTION TO DBMS 13

e.g. A cust_acct relationship associates a customer with each account he or she has.

The set of all entities or relationships of the same type is called the entity set or relationship set.

Another essential element of the E-R diagram is the mapping cardinalities, which express the number of entities to which another entity can be associated via a relationship set.

The overall logical structure of a database can be expressed graphically by an E-R

diagram:

rectangles: represent entity sets.

ellipses: represent attributes.

diamonds: represent relationships among entity sets.

lines: link attributes to entity sets and entity sets to relationships.

Entity-relationship model

2. Object-oriented data model:

Object-oriented programming (especially in Java, C++, or C#) has become the

popular software development methodology. This led to the development of an

object-oriented data model.

Record-based logical models:

Also describe data at the conceptual and view levels.Named so because the database is structured in fixed-format records of several types.Each record type defines a fixed number of fields, or attributes.The three most widely-accepted models are the relational, network, and hierarchical.

UNIT 1 INTRODUCTION TO DBMS 14

1.The Relational Model.

Data and relationships are represented by a collection of tables. Each table has a number of columns with unique names.

Student_id Name Subjects Class 1 Bob CS 1

20 Tom MATH 2

2. The Network Model.

Data are represented by collections of records. Relationships among data are represented by links. Organization is that of an arbitrary graph.

3. The Hierarchical Model.

Similar to the network model. Organization of the records is as a collection of trees, rather than arbitrary

graphs.

UNIT 1 INTRODUCTION TO DBMS 15