DBMS Unit 1
DBMS Unit 1
Dahiphale P. B.
Department of
Computer Science & Engineering
Introduction
• Data – Any fact that can be recorded
e.g., - texts, numbers, alphanumeric, audio, video, image.
• 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.
• 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.
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).
• Atomicity of updates
• Security problems
Application Application
Server
Programs Programs
Database Database
• 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.
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
• 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..
• (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.
•Each table has multiple row and columns and each column has unique name.
1. Attribute :
•Attribute is the name of column.
2. Domains :
•domain the set of values of same date type .
social-security customer-street
account-number
customer-name customer-city balance
• 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