0% found this document useful (0 votes)
38 views37 pages

DBMS Unit 1

This document discusses database management systems (DBMS). It defines key concepts like data, databases, DBMS, and database systems. It explains that a DBMS allows for the convenient and efficient storage and retrieval of database information. The document also discusses different types of databases, DBMS software, languages used, applications, and users including naive users, sophisticated users, application programmers, and database administrators. It compares DBMS to file processing systems and describes DBMS architectures and views.

Uploaded by

Soham Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views37 pages

DBMS Unit 1

This document discusses database management systems (DBMS). It defines key concepts like data, databases, DBMS, and database systems. It explains that a DBMS allows for the convenient and efficient storage and retrieval of database information. The document also discusses different types of databases, DBMS software, languages used, applications, and users including naive users, sophisticated users, application programmers, and database administrators. It compares DBMS to file processing systems and describes DBMS architectures and views.

Uploaded by

Soham Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Database Management Systems

Dahiphale P. B.
Department of
Computer Science & Engineering
Introduction
• Data – Any fact that can be recorded
e.g., - texts, numbers, alphanumeric, audio, video, image.

• Database – Collection of interrelated data


• Types of database –
 Traditional database
 Multimedia database
 Geographic Information System (GIS) Database
 Real-time database
 Data Warehouse (huge volume of historical data)

• DBMS – Collection of interrelated data and a set of programs to access those data. It helps
us to store and retrieve database information in a convenient and efficient manner.

Database (DB) + Database Management System (DBMS) = Database System (DBS)

Koushik De- CSE, UEMK 2


Introduction (contd..)
• DBMS Softwares – MS Access, Oracle, SQL Server, MySQL DB2, SYBASE, etc.
MS Excel – Does possess data management capabilities, but not a pure DBMS.

• Languages used by DBMS Softwares – SQL, PL/SQL

• Applications – Banking, Airline, Retail, Manufacturing, Telecommunication,


Universities, etc.

• Users of Database –
 Naive Users – Who knows nothing about the database but interacts with the
system by invoking one of the application programs that have been written earlier.

 Sophisticated Users – performs the same task of data entry not by using any
application program, but by means of query language like SQL.

Koushik De- CSE, UEMK 3


Introduction (contd..)
 Application Programmers – Developers who interact with the database by means of
DML queries or Rapid Action Development (RAD) tools. These DML queries are
written in the application programs like C, C++, JAVA, Pascal etc. These queries are
converted into object code to communicate with the database. For example, writing a C
program to generate the report of employees who are working in particular department
will involve a query to fetch the data from database. It will include a embedded SQL
query in the C Program.

 Sophisticated Users – They are sophisticated users who write specialized database
applications like computer-aided designs, knowledge and expert systems that store data
with complex data types (e.g., audio/video data, graphics data).

 Database Administrators (DBA) – A person or a group of persons who monitors the


database management system handling.
 Creates the original database
 Makes physical changes (modifications) to the scema
 Grants authorization for data access
 Does routine maintenance and periodic back up.

Koushik De- CSE, UEMK 4


DBMS Vs. File-processing Systems
• Data redundancy and inconsistency

• Difficulty in accessing data

• Data isolation – multiple files and formats

• Integrity problems (enforcing consistency constraints)

• Atomicity of updates

• Concurrent access by multiple users

• Security problems

Koushik De- CSE, UEMK 5


DBMS Architectures
User User

Application Application
Server
Programs Programs

 Database  Database

Two-tier Architecture Three-tier Architecture

Koushik De- CSE, UEMK 6


Views

• Part of the database that is visible to a particular user, for e.g., in a banking
system, the person who checks the account debits and credits of a customer is
not granted access to the payroll system. The account, depositor and borrower
tables are his view.

• Differ from person to person.

• The authorization of access is granted by the DBA.

Koushik De- CSE, UEMK 7


Levels of Abstraction
Users
 User View level describes how users see the
data.

 Conceptual or Logical level defines logical


structure

View 1 View 2 View 3


 Physical level describes the files and indexes
used.
Conceptual Schema
also known as the
ANSI/SPARC model Physical Schema

DB
8
Example: University Database
• Conceptual schema:
• Students (sid: string, name: string, age: integer, gpa:real)
• Courses (cid: string, cname:string, credits:integer)
• Enrolled (sid:string, cid:string, grade:string)
View 1 View 2 View 3
• External Schema (View Level):
• Course info (cid:string, enrollment:integer)
Conceptual Schema

• Physical schema: Physical Schema


• Relations stored as unordered files.
• Index on first column of Students.
DB

Koushik De- CSE, UEMK 9


Instance & Schema
• Instance : Collection of information stored in the database at a particular moment is called as
instance of database.
• It is also called as database state.
• Schema : The overall design of the database is called as schema.
• Schema is change very infrequently.
• Types of schema :
• 1.Physical Schema : It is the lowest lower. i.e. Physical level.
• 2.Logical Schema : It is the intermediate level. i.e. Logical level.
• 3.Sub schema : It is the highest level . i.e. view level .

Dibyendu B. Seal - CSE, UEMK 10


Data Independence
• Data independence means the property to change
the overall logical or physical structure of the data
without changing the application programs view
View 1 View 2 View 3
of data.
• View created for users does not have any change .
• It is defined as the ability of an application to Conceptual Schema
change in storage structure.
Logical data independence: It is ability to
modify the logical schema. Modifications at the Physical Schema
logical level are necessary.
The overall logical structure of data may be may
be changed without changing application program .
DB

Koushik De- CSE, UEMK 11


For example : To achieve this, attribute from different tables are considered and on those attributes
query is written.

Physical data independence:


Physical data independence is the ability to modify the physical schema .
• Modification at the physical level are necessary to improve performance . It means we change the
physical storage /level without affecting the logical or external view.
• Physical layout & Organization of data may be changed without changing either the overall logical
structure of the data or the application programs.
• For example: we can add extra field without disturbing the old records .
• Char address[20] is added.

Dibyendu B. Seal - CSE, UEMK 12


Overall Structure of DBMS:
• Components of DBMS are classified as follows:
• 1. Users:

• 1. Naive users:  Naive users are those users who do not have any technical knowledge about
the DBMS. they use the database through application programs by using simple interface.
they perform all operation by using simple command provided in the user interface.
Example: Facebook..

• 2.Application programmers : Application programmers is the person who is


responsible for implementing the required functionality of database for the end users. 
• 3.Sophisticated users : sophisticated users are the users who are familiar with the
structure of database such users can use a query language such as SQL to perform the
required operations on database some sophisticated users can also write application
programs.

4.Database administrator : database administrator is responsible for, managing the


whole database system.  he/she designs create and maintain the database. he/she
manages the users who can access the database and control integrity issue. he/she also
monitor the performance of the system and make changes in the system as and when
required. 
2.Query Processor :
• (I) DML Pre-compiler: It translates DML statements in a query language into low level
instructions that query. It is also attempts to transform user request into an equivalent but more
efficient form.

• (II)Compiler: Application Programmer develop the application program this program compile
the compiler .

• (III) DDL interpreter :  it interprets the DDL statements and records them in a set of tables
containing meta data or data dictionary.Develop table & query runs on table . Ex. Student Table.

• (IV) Query evaluation engine : it executes low level instructions generated by The DML
complier
• (V) Application Program object code : After compile the application program generate object
code .
3. Storage manager: it provides the interface between the low-level data stored in the
database and application programs and queries submitted to the system.

• (I) transaction manager: it ensures that the database remains in the consistent state despite
the system failure and that concurrent transaction execution proceed without conflicting

• (II) file manager: it manages the allocation of space on disk storage and the data structures
used to represent information stored on disk. 

• (III) Buffer manager: it responsible for fixing data from disk storage into main memory and
deciding what data to cache in memory. 
• 4. Data structure:
• Following data structure are required as part of the physical
system implementation :
• (I) Data files : it stores the database.
• (II) Data dictionary : it stores media data (data about data)
about the structure of the database.
• (III) Indices :  provides fast access to data items that hold
particular values.
• (IV) Statistical data : it stores statistical  information about the
data in the database this information used by query processor
to select efficient way to execute query .
Data Models :
• Data model is collection of describe the structure of a database.
• Describe how a database is structured & used .
• Collection of descrebing data, data schema & consistency.
• Data models are classified into two types:
• 1. Logical model
• 2.Physical model
1. Logical model:
i) Object based logical model : It is used to logical level & view level .
Object based logical model :
1) Entity relationship model
2) Object oriented model
3) Semantic data model
4) Functional data model
ii) Record based logical model : It is used to logical level & physical level
• 1) Network model
• 2) Hierarchical model
• 3) Relationship Model
• 2. Physical model :
• It is used to describe data at the lowest level
• Two types : 1) Unifying Model
2)Frame Memory Model
1)Network Model :
Collection of records & relationship among data are represented by links .
Some data were more than one parent per child so, the network model permitted the
modeling of many to many relationship .
Network model consist of network diagram .
• The complete network of relationship is represent by several pair wise
sets .
• A set defined 1:N relationship or 1:1 or M:N relationship .
• Eg: Employee & Customer .
• Advantages:
• 1. Ability to handle more relationship type: It handle the one to one &
many to many relationship.
• 2.Ease of data access : A relationship is a set each set comprises of two
types of record .
• Disadvantages:
• 1.System Complexity : Data are accessed one record at a time .
• This make it essential for the database desisigners , administrators & programmers
to be familer with the internal data structure.
• 2.Lack of structural independence :
• Making Structural modification to the database is very difficult in the network
database .
• Any changes to the database structure require the application programs to be
modified before they can access data .
• 2) Hierarchical Model :
• It Organizes data in a tree structure.
• It Organizing a database with multiple one to many relationship.
• One parent can have many children but children are allowed only one parent

• Same as network model in the sense that data and relationship among data are presented by
records and links
• Data is a series of records , which have set of field attached to it .
Advantages:
• It allow easy addition and deletion of new information.

• Top of hierarchy is very fast to access.  


Disadvantages :
• database can be very slow when searching for information on the lower entities.
• Many to many are not supported .
3) Relational Model :
•Collection of tables to represent both data and relationship among those data.

•Each table has multiple row and columns and each column has unique name.

•Represent data in the form of two dimensional tables.

1. Attribute :
•Attribute is the name of column.

•To attribute of relationship can have same name.

2. Domains :
•domain the set of values of same date type .

•Domain of an attribute is defined as a set of allow values for the attributes.


Advantages :
• 1.Structure independence .
• 2.improved simplicity.
• 3.Easier database design , implementation , management & use .
• 4.Powerful database management system.
• 5.SQL query capability.
• Disadvantages:
• Possibility of poor design & implementation .
• Substantial hardware & system software overhead .
1.6: Data Modeling using ER-Model :
• It is a high-level conceptual data model .
• Developed in 1976 to facilitate database design.
• It is graphical representation of the database system..
• Features of ER-Model :
• ER Diagram used for representing ER model
• It is used for the purpose of good database design by the database developer .
• It is very simple & easy to understand by various types of user & designers.
• Components of ER – Model:
• 1.Rectangles - - Which represents entity .
• 2.Ellipse - - Which represent attribute.
• 3.Diamond – -Which represent relationship among entities .
Entity-Relationship (E-R) Model

social-security customer-street
account-number
customer-name customer-city balance

customer depositor account

Koushik De- - CSE, UEMK 27


Koushik De- - CSE, UEMK
4.Lines- - which represent link attribute to entities & entity sets to
relationships.
• Entities :
• Is any object to store information about database .
• Individual object are called entity .
• Entities are represent by rectangles .
• Group of same type of object are called entity .
• Entity set / Types :
• An entity set is a set of entities of the same type that share the same properties or
attribute .
• 1. Weak entity
• 2. Strong entity
1. Weak Entity sets :
• The entity sets that does not have sufficient attribute to define the
primary key are called as weak entity set .
• Weak entity sets has to be dependent on strong entity sets.
• 2. Strong Entity sets:
• It is also called as owner entity sets.
• The entity sets that have sufficient attribute to define the primary key are called
strong entity sets.
• The relationship that is associating weak entity set with strong entity set is called
as identifying relationship .
Types of attributes :
• 1. Simple & Composite Attribute :
• Simple attribute that consist of a single atomic Value.
• A simple attribute cannot be subdivided .
• Example: Age .
• A composite attribute is a attribute that can be subdivided.
• Example: attribute Name can be subdivided into First name, Middle name , Last
name.
• 2. Single value and multivalued attribute :
• Single valued attributes can I have only a single value.
• example : a student can have only one registration number.
• multivalued attribute can have multiple values.
Example : A person may have multiple phone numbers multiple degrees.

• 3. Derived attributes:
• The value for the delivery attribute is derived from the stored attribute.
Example : date of birth of a person is a stored attribute the value for the attribute age can be
derived by subtracting the date of birth from the current date.
• An attribute is that’s value is the derived  from store attribute is called as derived attribute
• 4. Null attribute:
• Null  value is used when an entity does not have a value for an attribute.
• Attribute is unknown or missing.

Mapping cardinality:
• Mapping cardinality express the number of entities to which another entity can be associated
by a relationship set.
• 1. One to one :
• An entity in A associated with at most one entity in B .
• 2. One to many :
• An entity in A is associated with any number of entities in B.
One-One and One-Many

Koushik De- - CSE, UEMK 34


• 3. Many to one :
• An entity in A is associated with at most one entity in B.
• An entity in B however can be associated with any number of entities in A.
• 4. Many to many :
• An entity in A is associated with any number of entities in B and an entity in B
associated with any number of entities in A.
Many-one and many-many

Koushik De- - CSE, UEMK 36


Thank you

You might also like