SlideShare a Scribd company logo
1 of 29
Download to read offline
DATABASE MANAGEMENT SYSTEM
(FOR BOTH CSE-4TH
-SEM/MECH-3RD
SEM DEPARTMENT)
MODULE-1
Database Management System (DBMS)
DBMS contains information about a particular enterprise
• Collection of interrelated data
• Set of programs to access the data
• An environment that is both convenient and efficient to use
Database Applications:
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Online retailers: order tracking, customized recommendations
• Manufacturing: production, inventory, orders, supply chain
• Human resources: employee records, salaries, tax deductions
Purpose of Database Systems
In the early days, database applications were built directly on top of
file systems
Drawbacks of using file systems to store data:
• Data redundancy and inconsistency
• Multiple file formats, duplication of information in different files
• Difficulty in accessing data
• Need to write a new program to carry out each new task
• Data isolation — multiple files and formats
• Integrity problems
• Integrity constraints (e.g. account balance > 0) become “buried” in
program code rather than being stated explicitly
• Hard to add new constraints or change existing ones Databases touch all
aspects of our lives
DBMS Architecture
Different abstract levels
- a widely accepted general architecture for a database
- database described by three abstract levels
- internal schema (physical database)
- conceptual schema (conceptual database)
- external schema (view) Objectives
- insulation of application programs and data
- support of multiple user views
- use of schema to store the DB description (mete-data)
The Three Schema Architecture :
External schema
- describes a subset of the database that a particular user group is interested
in, according to the format the format user wants, and hides the rest
- may contain virtual data that is derived from the files, but is not explicitly
stored Conceptual schema
- hides the details of physical storage structures and concentrates on
describing entities, data types, relationships, operations, and constraints.
Internal schema
- describes the physical storage structure of the DB
- uses a low-level (physical) data model to describe the complete details of
data storage and access paths
THREE-LEVEL ARCHITECTURE
EXTERNAL LEVEL (highest 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. The user is not aware of the existence of any attributes
that are missing from the view.
̒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.
̒Represents:
- entities, attributes, relations
- constraints on data
- semantic information on data
- security, integrity information
Supports each external view: any data available to a user must be contained
in or derivable from the conceptual level.
INTERNAL LEVEL
̒Physical representation of the DB on the computer.
̒How the data is stored in the database.
̒Physical implementation of the DB to achieve optimal run time
performance and storage space utilization.
- Storage space allocation for data and indexes
- Record description for storage
- Record placement
- Data compression, encryption
PHYSICAL LEVEL
Managed by the OS under the direction of the DBMS.
SCHEMAS, MAPPINGS, INSTANCES
DB schema: overall description of the DB.
Three different schemas according to the level of abstraction.
DBMS: mapping between schemas consistency of schemas
Conceptual/Internal Mapping: to find the actual record (combinations) in
physical storage that constitutes a logical Record in the conceptual schema.
External/Conceptual Mapping: map names in the user’s view
Onto the relevant part of the conceptual schema.
Instances and Schemas
Similar to types and variables in programming languages
Schema – the logical structure of the database
l Example: The database consists of information about a set of customers and
accounts and the relationship between them)
l Analogous to type information of a variable in a program
l Physical schema: database design at the physical level
l Logical schema: database design at the logical level
Instance – the actual content of the database at a particular point in time
l Analogous to the value of a variable
Database instance: the data in the DB at any particular point in time.
DATA INDEPENDENCE
The ability to modify a scheme definition in one level without Affecting a
scheme definition in a higher level is called data independence.
1. There are two kinds:
Logical data independence
̒The ability to modify the conceptual scheme without causing application
programs to be rewritten.
̒Immunity of external schemas to changes in the conceptual schema.
̒Usually done when logical structure of database is altered
Physical data independence
̒The ability to modify the internal scheme without having to change the
conceptual or external schemas.
̒Modifications at this level are usually to improve performance.
Three Schema Architecture
Data and meta-data: - three schemas are only meta-data (descriptions of data)
- data actually exists only at the physical level Mapping
- DBMS must transform a request specified on an external schema into a
request against the conceptual schema, and then into the internal schema
- requires information in meta-data on how to accomplish the mapping
among various levels
- overhead (time-consuming) leading to inefficiencies
- few DBMSs have implemented the full three-schema architecture
Benefits of Three Schema Architecture:
Logical data independence
- The capacity to change the conceptual schema without having to change
external schema or application programs ex: Employee (E#, Name, Address,
and Salary) A view including only E# and Name is not affected by changes in
any other attributes.
Physical data independence
- the capacity to change the internal schema without having to change the
conceptual (or external) schema
- internal schema may change to improve the performance (e.g., creating
additional access structure)
- easier to achieve logical data independence, because application programs
are dependent on logical structures
Data Models
Data abstraction
- one fundamental characteristic of the database approach
- hides details of data storage that are not needed by most database users and
applications
Data model
- a set of data structures and conceptual tools used to describe the structure of
a database (data types, relationships, and constraints)
- used in the definition of the conceptual, external, and internal schema
- must provide means for DB designers to represent the real-world
information completely and naturally.
Data Models
High-level (conceptual) data models
- use concepts such as entities, attributes, relationships
- object-based models: ER model, OO model
Representational (implementation) data models
- most frequently used in commercial DBMSs
- record-based models: relational, hierarchical, network
Low-level (physical) data models
- to describe the details of how data is stored
- captures aspects of database system implementation: record structures
(fixed/variable length) and ordering, access paths (key indexing), etc.
Schemas and Instances
In any data model, it is important to distinguish between the description of
the database and the database itself. Database schema (meta-data)
- overall description of a database, specified by a set of definitions
- specified during database design (not change frequently)
- similar to the notion of type definition in programs Database instance
- current contents of the database (actual data): DB state
- may change frequently Distinction between database schema and database
state
- a database just specified (or defined) is in empty state
- initial state would be achieved when the data is loaded
- DBMS is responsible to ensure every database state is valid
Data Definition and Manipulation Languages
Data definition language (DDL)
- not a procedural language
- notations for describing the types of entities and relationships among
entities
DDL statements --® data dictionary
Data manipulation language (DML)
- for accessing and modifying data
- non-procedural: specifying "what" to access
- procedural: specifying "what" and "how" to get
- non-procedural languages could be easy to use but may not be efficient
Database Administrator
Coordinates all the activities of the database system; the database
administrator has a good understanding of the enterprise’s information
resources and needs.
• Database administrator's duties include:
• Schema definition
• Storage structure and access method definition
• Schema and physical organization modification
• Granting user authority to access the database
• Specifying integrity constraints
• Acting as liaison with users
• Monitoring performance and responding to changes in requirements
Data Models
DATA MODELS
Data models are a collection of conceptual tools for describing data, data
relationships, and data semantics and data constraints. Components: structural
part manipulative part integrity rules There are three different groups:
Object-based Data Models
Record-based Data Models
Physical Data Models
Describe data at the conceptual and external levels Describe data at the
internal level
Object-based Data Models
- Entity-relationship model.
- Object-oriented model.
- Semantic data model.
- Functional data model
Record-based Data Models
̒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.
̒Each field is usually of a fixed length (this simplifies the implementation).
̒The three most widely accepted models are the
Relational, network, and hierarchical data model.
Physical Data Models
1. Are used to describe data at the lowest level.
2. Very few models, e.g.
• Unifying model.
• Frame memory.
Entity-relationship model
- popular high-level conceptual model used in DB design
- proposed by P. Chen in 1976 (ACM TODS)
- Perception of real-world consisting of a collection of entities and
relationships among them OO model.
- DB is defined in terms of objects, their properties, and their operations
(methods) Relational model
- represents a DB as a collection of tables Network model
- represents DB as record types and 1:N relationships Hierarchical model
- represents data as hierarchical tree structures
An entity may be defined as a thing which is recognized as being capable of
an independent existence and which can be uniquely identified. An entity is
an abstraction from the complexities of some domain.
E-R Diagram Notation:
Entity Key attributes
Weak Entity Multivalue
attribute
Relationship
Attributes Composite
Attributes
Relationship between two entities
ER Diagrams
Rectangles represent entity sets.
-Diamonds represent relationship sets.
-Lines link attributes to entity sets and entity sets to relationship sets.
-Ellipses represent attributes
-Double ellipses represent multivalve attributes.
-Dashed ellipses denote derived attributes.
-Underline indicates primary key attributes (will study later)
ER Diagram With Composite, Multivalued, and Derived Attributes
Relationship Sets with Attributes:
OneToMany Relationship:
ManyToOneRelationships:
In a many to one relationship a loan is associated with several (including
0) customers via borrower, a customer is associated with at most one
Loan via borrower.
ManyToMany Relationship:
Specialization Example:
Entities: Entity-a thing (animate or inanimate) of independent physical or
conceptual existence and distinguishable. In the University database context,
an individual student, faculty member, a class room, courses are entities.
Entity Set or Entity Type-Collection of entities all having the same
properties. Student entity set –collection of all student entities. Course entity
set –collection of all course entities
Attributes - Each entity is described by a set of attributes/properties.
Student entity Stud Name–name of the student.
Roll Number–the roll number of the student.
Sex–the gender of the student etc. All entities in an Entity set/type have the
same set of attributes
Types of Attributes
•Simple Attributes-having atomic or indivisible values.
example: Dept–a string Phone Number–an eight digit number
•Composite Attributes-having several components in the value.
example: Qualification with components (Degree Name, Year, University
Name)
•Derived Attributes-Attribute value is dependent on some other attribute.
Example: Age depends on Date Of Birth. So age is a derived attribute.
•Single-valued-having only one value rather than a set of values.
-for instance, Place Of Birth–single string value.
•Multi-valued -having a set of values rather than a single value.
-for instance, Courses Enrolled attribute for student Email Address attribute
for student Previous Degree attribute for student.
•Attributes can be:-simple single-valued, simple multi-valued, composite
single-valued or composite multi-valued
Diagrammatic Notation for Entities entity -rectangle attribute -ellipse
connected to rectangle multi-valued attribute -double ellipse composite
attribute -ellipse connected to ellipse derived attribute-dashed ellipse
Relationships
•When two or more entities are associated with each other, we have an
instance of a Relationship.
•E.g.: student Ramesh enrolls in Discrete Mathematics course
•Relationship enrolls has Student and Course as the participating entity sets.
•Tuples in enrolls–relationship instances
•enrolls is called a relationship Type/Set.
ER Diagram for a Banking Enterprise:
Summary off Symbolls Used iin ER Notation:
Cardinality Ratios/Mappings
•One-to-one: An E1entity may be associated with at most one E2 entity and
similarly an E2entity may be associated with at most one E1 entity.
•One-to-many: An E1entity may be associated with many E2entities whereas
an E2entity may be associated with at most one E1entity
.•Many-to-one: …( similar to above)
•Many-to-many: Many E1entities may be associated with a single E2 entity
and a single E1entity may be associated with many E2entities
Key Attributes:
Primary Key: The primary key of a relational table uniquely identifies each
record in the table. It can either be a normal attribute that is guaranteed to be
unique (such as Social Security Number in a table with no more than one
record per person) or it can be generated by the DBMS.
Examples: Imagine we have a STUDENTS table that contains a record for
each student at a university. The student's unique student ID number would
be a good choice for a primary key in the STUDENTS table. The student's
first and last name would not be a good choice, as there is always the chance
that more than one student might have the same name.
Foreign Key:A foreign key is a field in a relational table that matches the
primary key column of another table. The foreign key can be used to cross-
reference tables
Referential Integrity
Referential integrity is a database concept that ensures that relationships
between tables remain consistent. When one table has a foreign key to
another table, the concept of referential integrity states that you may not add a
record to the table that contains the foreign key unless there is a
corresponding record in the linked table. It also includes the techniques
known as cascading update and cascading delete, which ensure that changes
made to the linked table are reflected in the primary table.
Referential integrity enforces the following three rules:
1. We may not add a record to the Employees table unless the Managed By
attributes points to a valid record in the Managers table.
2. If the primary key for a record in the Managers table changes, all
corresponding records in the Employees table must be modified using a
cascading update.
3. If a record in the Managers table is deleted, all corresponding records in
the Employees table must be deleted using a cascading delete.
Importance of Referential Integrity
By providing specification of columns within a referencing table that are
foreign keys for columns in some other referenced table, referential integrity
is a reliable mechanism which prevents accidental database corruptions when
doing inserts, updates, and deletes. It states that a row cannot exist in a table
with a non-null value for a referencing column if an equal value does not
exist in a referenced column.
Once we define the employee_number as a foreign key in employee_phone
relation, if we try to insert a row with a primary key value that does not exist
in employee table, the system will not allow this insertion.
The following summarize the benefits of referential integrity:
a) Ensure data integrity and consistency base on primary key and foreign key
b) Increases development productivity, because it is not necessary to code
SQL statements to enforce referential constraints, the Teradata RDBMS
automatically enforces referential integrity.
Candidate Key:
A candidate key is a combination of attributes that can be uniquely used to
identify a database record without any extraneous data. Each table may have
one or more candidate keys. One of these candidate keys is selected as the
table primary key.
Check Constraint:
A check constraint (also known as table check constraint) is a condition that
defines valid data when adding or updating an entry in a table of a relational
database. A check constraint is applied to each row in the table. The
constraint must be a predicate. It can refer to a single or multiple columns of
the table. The result of the predicate can be TRUE, FALSE, or UNKNOWN,
depending on the presence of NULLs. If the predicate evaluates to
UNKNOWN, then the constraint is not violated and the row can be inserted
or updated in the table.
Each check constraint has to be defined in the CREATE TABLE or ALTER
TABLE statement using the syntax:
1. CREATE TABLE table_name (...,CONSTRAINT constraint_name CHECK (
predicate ), ... )
2. ALTER TABLE table_name ADD CONSTRAINT constraint_name CHECK (
predicate )
NOT NULL Constraint:
A NOT NULL constraint is functionally equivalent to the following check constraint
with an IS NOT NULL predicate:CHECK (column IS NOT NULL)
Domain Constraints:
A domain is defined as the set of all unique values permitted for an attribute.
For example, a domain of date is the set of all possible valid dates, a domain
of integer is all possible whole numbers, a domain of day-of-week is
Monday, Tuesday ... Sunday.
This in effect is defining rules for a particular attribute. If it is determined that
an attribute is a date then it should be implemented in the database to prevent
invalid dates being entered.
A domain of possible values should be associated with every attribute. These
domain constraints are the most basic form of integrity constraint. They are
easy to test for when data is entered.
Domain types
1. Attributes may have the same domain, e.g. cname and employee-name.
2. It is not as clear whether bname and cname domains ought to be distinct.
3. At the implementation level, they are both character strings.
4. At the conceptual level, we do not expect customers to have the same
names as branches, in general.
5. Strong typing of domains allows us to test for values inserted, and
whether queries make sense. Newer systems, particularly object-oriented
database systems, offer a rich set of domain types that can be extended
easily.
Database Users:
Users are differentiated by the way they expect to interact with
the system
-Application programmers – interact with system through DML calls
-Sophisticated users – form requests in a database query language
-Specialized users – write specialized database applications that do
not fit into the traditional data processing framework
-Naïve users – invoke one of the permanent application programs that
have been written previously
l Examples, people accessing database over the web, bank tellers,clerical staff
Database Administrator
n Coordinates all the activities of the database system; the
database administrator has a good understanding of the Enterprise’s
information resources and needs.
Database administrator's duties include:
-Schema definition
-Storage structure and access method definition
-Schema and physical organization modification
-Granting user authority to access the database
-Specifying integrity constraints
-Acting as liaison with users
-Monitoring performance and responding to changes in
requirements
Keys:
-A super key of an entity set is a set of one or more attributes
whose values uniquely determine each entity.
-A candidate key of an entity set is a minimal super key
l Customer_id is candidate key of customer
l account_number is candidate key of account
-Although several candidate keys may exist, one of the candidate
keys is selected to be the primary key.
! " # #$ % &' (# ' ) $
" # #$ $ *& ) #) && ) $ +
" # #$
&' (# ' ) $ ,
" # #$ $ *#')+
" # #$ $ *#')
" # #$ - **&
" # #$ . ' ' $ # ' ) $
" # #$ / # ) #'# $ ' ) $
Dbms module i

More Related Content

What's hot

Advanced Database Lecture Notes
Advanced Database Lecture NotesAdvanced Database Lecture Notes
Advanced Database Lecture NotesJasour Obeidat
 
ANSI-SPARC - Star Trek style - v2.0
ANSI-SPARC - Star Trek style - v2.0ANSI-SPARC - Star Trek style - v2.0
ANSI-SPARC - Star Trek style - v2.0Damian T. Gordon
 
Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207Burhan Chaudhry
 
00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabusBishal Ghimire
 
DATABASE Fp304 chapter 1
DATABASE Fp304   chapter 1DATABASE Fp304   chapter 1
DATABASE Fp304 chapter 1Radio Deejay
 
Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Vidyasagar Mundroy
 
Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemEddyzulham Mahluzydde
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Userssontumax
 
Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database DesignSondra Willhite
 
data base management system (DBMS)
data base management system (DBMS)data base management system (DBMS)
data base management system (DBMS)Varish Bajaj
 
Data base management system and Architecture ppt.
Data base management system and Architecture ppt.Data base management system and Architecture ppt.
Data base management system and Architecture ppt.AnkitAbhilashSwain
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentationsameerraaj
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) iRavinder Kamboj
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationGuru Ji
 
Database management system
Database management systemDatabase management system
Database management systemashishkthakur94
 

What's hot (20)

Advanced Database Lecture Notes
Advanced Database Lecture NotesAdvanced Database Lecture Notes
Advanced Database Lecture Notes
 
ANSI-SPARC - Star Trek style - v2.0
ANSI-SPARC - Star Trek style - v2.0ANSI-SPARC - Star Trek style - v2.0
ANSI-SPARC - Star Trek style - v2.0
 
Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207
 
00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus
 
DATABASE Fp304 chapter 1
DATABASE Fp304   chapter 1DATABASE Fp304   chapter 1
DATABASE Fp304 chapter 1
 
DBMS CONCEPT
DBMS CONCEPTDBMS CONCEPT
DBMS CONCEPT
 
Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)
 
Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management System
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Users
 
Ch1
Ch1Ch1
Ch1
 
Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database Design
 
Bab9
Bab9Bab9
Bab9
 
data base management system (DBMS)
data base management system (DBMS)data base management system (DBMS)
data base management system (DBMS)
 
Chapter2
Chapter2Chapter2
Chapter2
 
Data base management system and Architecture ppt.
Data base management system and Architecture ppt.Data base management system and Architecture ppt.
Data base management system and Architecture ppt.
 
Ch09
Ch09Ch09
Ch09
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 
Database management system
Database management systemDatabase management system
Database management system
 

Similar to Dbms module i

database introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdfdatabase introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdfparveen204931475
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to DatabaseSiti Ismail
 
Database system concepts
Database system conceptsDatabase system concepts
Database system conceptsKumar
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfSameerKhanPathan7
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxAnmolThakur67
 
Database Management Systems.ppt
Database Management Systems.pptDatabase Management Systems.ppt
Database Management Systems.ppttahakhan699813
 
A N S I S P A R C Architecture
A N S I  S P A R C  ArchitectureA N S I  S P A R C  Architecture
A N S I S P A R C ArchitectureSabeeh Ahmed
 
Data base management system
Data base management systemData base management system
Data base management systemNavneet Jingar
 
Ch1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptxCh1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptx01fe20bcv092
 
Lecture 1 to 3intro to normalization in database
Lecture 1 to 3intro to  normalization in databaseLecture 1 to 3intro to  normalization in database
Lecture 1 to 3intro to normalization in databasemaqsoodahmedbscsfkhp
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbmsranjana dalwani
 

Similar to Dbms module i (20)

database introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdfdatabase introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdf
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Dbms unit i
Dbms unit iDbms unit i
Dbms unit i
 
unit 1.pdf
unit 1.pdfunit 1.pdf
unit 1.pdf
 
Database system concepts
Database system conceptsDatabase system concepts
Database system concepts
 
Dbms
DbmsDbms
Dbms
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdf
 
Database Management System ppt
Database Management System pptDatabase Management System ppt
Database Management System ppt
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
Database Management Systems.ppt
Database Management Systems.pptDatabase Management Systems.ppt
Database Management Systems.ppt
 
A N S I S P A R C Architecture
A N S I  S P A R C  ArchitectureA N S I  S P A R C  Architecture
A N S I S P A R C Architecture
 
Dbms models
Dbms modelsDbms models
Dbms models
 
Data base management system
Data base management systemData base management system
Data base management system
 
27 fcs157al2
27 fcs157al227 fcs157al2
27 fcs157al2
 
Ch1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptxCh1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptx
 
Lecture 1 to 3intro to normalization in database
Lecture 1 to 3intro to  normalization in databaseLecture 1 to 3intro to  normalization in database
Lecture 1 to 3intro to normalization in database
 
Unit01 dbms
Unit01 dbmsUnit01 dbms
Unit01 dbms
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbms
 
DBMS-Unit-1.pptx
DBMS-Unit-1.pptxDBMS-Unit-1.pptx
DBMS-Unit-1.pptx
 
20CS402_Unit_1.pptx
20CS402_Unit_1.pptx20CS402_Unit_1.pptx
20CS402_Unit_1.pptx
 

More from SANTOSH RATH

Lesson plan proforma database management system
Lesson plan proforma database management systemLesson plan proforma database management system
Lesson plan proforma database management systemSANTOSH RATH
 
Lesson plan proforma progrmming in c
Lesson plan proforma progrmming in cLesson plan proforma progrmming in c
Lesson plan proforma progrmming in cSANTOSH RATH
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tcSANTOSH RATH
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tcSANTOSH RATH
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questionsSANTOSH RATH
 
( Becs 2208 ) database management system
( Becs 2208 ) database management system( Becs 2208 ) database management system
( Becs 2208 ) database management systemSANTOSH RATH
 
Expected Questions TC
Expected Questions TCExpected Questions TC
Expected Questions TCSANTOSH RATH
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tcSANTOSH RATH
 
Expected questions for dbms
Expected questions for dbmsExpected questions for dbms
Expected questions for dbmsSANTOSH RATH
 
Expected questions for dbms
Expected questions for dbmsExpected questions for dbms
Expected questions for dbmsSANTOSH RATH
 
Oops model question
Oops model questionOops model question
Oops model questionSANTOSH RATH
 
System programming note
System programming noteSystem programming note
System programming noteSANTOSH RATH
 
Operating system notes
Operating system notesOperating system notes
Operating system notesSANTOSH RATH
 

More from SANTOSH RATH (20)

Lesson plan proforma database management system
Lesson plan proforma database management systemLesson plan proforma database management system
Lesson plan proforma database management system
 
Lesson plan proforma progrmming in c
Lesson plan proforma progrmming in cLesson plan proforma progrmming in c
Lesson plan proforma progrmming in c
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questions
 
2011dbms
2011dbms2011dbms
2011dbms
 
2006dbms
2006dbms2006dbms
2006dbms
 
( Becs 2208 ) database management system
( Becs 2208 ) database management system( Becs 2208 ) database management system
( Becs 2208 ) database management system
 
Rdbms2010
Rdbms2010Rdbms2010
Rdbms2010
 
Expected Questions TC
Expected Questions TCExpected Questions TC
Expected Questions TC
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
 
Expected questions for dbms
Expected questions for dbmsExpected questions for dbms
Expected questions for dbms
 
Expected questions for dbms
Expected questions for dbmsExpected questions for dbms
Expected questions for dbms
 
Oops model question
Oops model questionOops model question
Oops model question
 
System programming note
System programming noteSystem programming note
System programming note
 
Operating system notes
Operating system notesOperating system notes
Operating system notes
 
Os notes
Os notesOs notes
Os notes
 
OS ASSIGNMENT 2
OS ASSIGNMENT 2OS ASSIGNMENT 2
OS ASSIGNMENT 2
 
OS ASSIGNMENT-1
OS ASSIGNMENT-1OS ASSIGNMENT-1
OS ASSIGNMENT-1
 
OS ASSIGNMENT 3
OS ASSIGNMENT 3OS ASSIGNMENT 3
OS ASSIGNMENT 3
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

Dbms module i

  • 1. DATABASE MANAGEMENT SYSTEM (FOR BOTH CSE-4TH -SEM/MECH-3RD SEM DEPARTMENT) MODULE-1 Database Management System (DBMS) DBMS contains information about a particular enterprise • Collection of interrelated data • Set of programs to access the data • An environment that is both convenient and efficient to use Database Applications: • Banking: all transactions • Airlines: reservations, schedules • Universities: registration, grades • Sales: customers, products, purchases • Online retailers: order tracking, customized recommendations • Manufacturing: production, inventory, orders, supply chain • Human resources: employee records, salaries, tax deductions Purpose of Database Systems In the early days, database applications were built directly on top of file systems
  • 2. Drawbacks of using file systems to store data: • Data redundancy and inconsistency • Multiple file formats, duplication of information in different files • Difficulty in accessing data • Need to write a new program to carry out each new task • Data isolation — multiple files and formats • Integrity problems • Integrity constraints (e.g. account balance > 0) become “buried” in program code rather than being stated explicitly • Hard to add new constraints or change existing ones Databases touch all aspects of our lives DBMS Architecture Different abstract levels - a widely accepted general architecture for a database - database described by three abstract levels - internal schema (physical database) - conceptual schema (conceptual database) - external schema (view) Objectives - insulation of application programs and data - support of multiple user views - use of schema to store the DB description (mete-data) The Three Schema Architecture : External schema - describes a subset of the database that a particular user group is interested in, according to the format the format user wants, and hides the rest - may contain virtual data that is derived from the files, but is not explicitly
  • 3. stored Conceptual schema - hides the details of physical storage structures and concentrates on describing entities, data types, relationships, operations, and constraints. Internal schema - describes the physical storage structure of the DB - uses a low-level (physical) data model to describe the complete details of data storage and access paths THREE-LEVEL ARCHITECTURE
  • 4. EXTERNAL LEVEL (highest 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. The user is not aware of the existence of any attributes that are missing from the view. ̒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. ̒Represents: - entities, attributes, relations - constraints on data - semantic information on data - security, integrity information Supports each external view: any data available to a user must be contained in or derivable from the conceptual level. INTERNAL LEVEL ̒Physical representation of the DB on the computer.
  • 5. ̒How the data is stored in the database. ̒Physical implementation of the DB to achieve optimal run time performance and storage space utilization. - Storage space allocation for data and indexes - Record description for storage - Record placement - Data compression, encryption PHYSICAL LEVEL Managed by the OS under the direction of the DBMS. SCHEMAS, MAPPINGS, INSTANCES DB schema: overall description of the DB. Three different schemas according to the level of abstraction. DBMS: mapping between schemas consistency of schemas Conceptual/Internal Mapping: to find the actual record (combinations) in physical storage that constitutes a logical Record in the conceptual schema. External/Conceptual Mapping: map names in the user’s view Onto the relevant part of the conceptual schema. Instances and Schemas Similar to types and variables in programming languages Schema – the logical structure of the database l Example: The database consists of information about a set of customers and accounts and the relationship between them) l Analogous to type information of a variable in a program l Physical schema: database design at the physical level l Logical schema: database design at the logical level Instance – the actual content of the database at a particular point in time
  • 6. l Analogous to the value of a variable Database instance: the data in the DB at any particular point in time. DATA INDEPENDENCE The ability to modify a scheme definition in one level without Affecting a scheme definition in a higher level is called data independence. 1. There are two kinds: Logical data independence ̒The ability to modify the conceptual scheme without causing application programs to be rewritten. ̒Immunity of external schemas to changes in the conceptual schema. ̒Usually done when logical structure of database is altered
  • 7. Physical data independence ̒The ability to modify the internal scheme without having to change the conceptual or external schemas. ̒Modifications at this level are usually to improve performance. Three Schema Architecture Data and meta-data: - three schemas are only meta-data (descriptions of data) - data actually exists only at the physical level Mapping - DBMS must transform a request specified on an external schema into a request against the conceptual schema, and then into the internal schema - requires information in meta-data on how to accomplish the mapping among various levels - overhead (time-consuming) leading to inefficiencies - few DBMSs have implemented the full three-schema architecture Benefits of Three Schema Architecture: Logical data independence - The capacity to change the conceptual schema without having to change external schema or application programs ex: Employee (E#, Name, Address, and Salary) A view including only E# and Name is not affected by changes in any other attributes. Physical data independence - the capacity to change the internal schema without having to change the conceptual (or external) schema - internal schema may change to improve the performance (e.g., creating additional access structure) - easier to achieve logical data independence, because application programs are dependent on logical structures
  • 8. Data Models Data abstraction - one fundamental characteristic of the database approach - hides details of data storage that are not needed by most database users and applications Data model - a set of data structures and conceptual tools used to describe the structure of a database (data types, relationships, and constraints) - used in the definition of the conceptual, external, and internal schema - must provide means for DB designers to represent the real-world information completely and naturally. Data Models High-level (conceptual) data models - use concepts such as entities, attributes, relationships - object-based models: ER model, OO model Representational (implementation) data models - most frequently used in commercial DBMSs - record-based models: relational, hierarchical, network Low-level (physical) data models - to describe the details of how data is stored - captures aspects of database system implementation: record structures (fixed/variable length) and ordering, access paths (key indexing), etc. Schemas and Instances In any data model, it is important to distinguish between the description of the database and the database itself. Database schema (meta-data)
  • 9. - overall description of a database, specified by a set of definitions - specified during database design (not change frequently) - similar to the notion of type definition in programs Database instance - current contents of the database (actual data): DB state - may change frequently Distinction between database schema and database state - a database just specified (or defined) is in empty state - initial state would be achieved when the data is loaded - DBMS is responsible to ensure every database state is valid Data Definition and Manipulation Languages Data definition language (DDL) - not a procedural language - notations for describing the types of entities and relationships among entities DDL statements --® data dictionary Data manipulation language (DML) - for accessing and modifying data - non-procedural: specifying "what" to access - procedural: specifying "what" and "how" to get - non-procedural languages could be easy to use but may not be efficient Database Administrator Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs. • Database administrator's duties include: • Schema definition
  • 10. • Storage structure and access method definition • Schema and physical organization modification • Granting user authority to access the database • Specifying integrity constraints • Acting as liaison with users • Monitoring performance and responding to changes in requirements Data Models DATA MODELS Data models are a collection of conceptual tools for describing data, data relationships, and data semantics and data constraints. Components: structural part manipulative part integrity rules There are three different groups: Object-based Data Models Record-based Data Models Physical Data Models Describe data at the conceptual and external levels Describe data at the internal level Object-based Data Models - Entity-relationship model. - Object-oriented model. - Semantic data model. - Functional data model Record-based Data Models ̒Named so because the database is structured in fixed format records of
  • 11. several types. ̒Each record type defines a fixed number of fields, or attributes. ̒Each field is usually of a fixed length (this simplifies the implementation). ̒The three most widely accepted models are the Relational, network, and hierarchical data model. Physical Data Models 1. Are used to describe data at the lowest level. 2. Very few models, e.g. • Unifying model. • Frame memory. Entity-relationship model - popular high-level conceptual model used in DB design - proposed by P. Chen in 1976 (ACM TODS) - Perception of real-world consisting of a collection of entities and relationships among them OO model. - DB is defined in terms of objects, their properties, and their operations (methods) Relational model - represents a DB as a collection of tables Network model - represents DB as record types and 1:N relationships Hierarchical model - represents data as hierarchical tree structures An entity may be defined as a thing which is recognized as being capable of an independent existence and which can be uniquely identified. An entity is an abstraction from the complexities of some domain. E-R Diagram Notation: Entity Key attributes Weak Entity Multivalue
  • 12. attribute Relationship Attributes Composite Attributes Relationship between two entities ER Diagrams Rectangles represent entity sets. -Diamonds represent relationship sets. -Lines link attributes to entity sets and entity sets to relationship sets. -Ellipses represent attributes -Double ellipses represent multivalve attributes. -Dashed ellipses denote derived attributes. -Underline indicates primary key attributes (will study later)
  • 13. ER Diagram With Composite, Multivalued, and Derived Attributes Relationship Sets with Attributes: OneToMany Relationship:
  • 14. ManyToOneRelationships: In a many to one relationship a loan is associated with several (including 0) customers via borrower, a customer is associated with at most one Loan via borrower. ManyToMany Relationship:
  • 15. Specialization Example: Entities: Entity-a thing (animate or inanimate) of independent physical or conceptual existence and distinguishable. In the University database context, an individual student, faculty member, a class room, courses are entities. Entity Set or Entity Type-Collection of entities all having the same properties. Student entity set –collection of all student entities. Course entity set –collection of all course entities Attributes - Each entity is described by a set of attributes/properties. Student entity Stud Name–name of the student. Roll Number–the roll number of the student. Sex–the gender of the student etc. All entities in an Entity set/type have the same set of attributes Types of Attributes •Simple Attributes-having atomic or indivisible values. example: Dept–a string Phone Number–an eight digit number •Composite Attributes-having several components in the value. example: Qualification with components (Degree Name, Year, University
  • 16. Name) •Derived Attributes-Attribute value is dependent on some other attribute. Example: Age depends on Date Of Birth. So age is a derived attribute. •Single-valued-having only one value rather than a set of values. -for instance, Place Of Birth–single string value. •Multi-valued -having a set of values rather than a single value. -for instance, Courses Enrolled attribute for student Email Address attribute for student Previous Degree attribute for student. •Attributes can be:-simple single-valued, simple multi-valued, composite single-valued or composite multi-valued Diagrammatic Notation for Entities entity -rectangle attribute -ellipse connected to rectangle multi-valued attribute -double ellipse composite attribute -ellipse connected to ellipse derived attribute-dashed ellipse Relationships •When two or more entities are associated with each other, we have an instance of a Relationship.
  • 17. •E.g.: student Ramesh enrolls in Discrete Mathematics course •Relationship enrolls has Student and Course as the participating entity sets. •Tuples in enrolls–relationship instances •enrolls is called a relationship Type/Set. ER Diagram for a Banking Enterprise:
  • 18. Summary off Symbolls Used iin ER Notation:
  • 19. Cardinality Ratios/Mappings •One-to-one: An E1entity may be associated with at most one E2 entity and similarly an E2entity may be associated with at most one E1 entity. •One-to-many: An E1entity may be associated with many E2entities whereas an E2entity may be associated with at most one E1entity .•Many-to-one: …( similar to above) •Many-to-many: Many E1entities may be associated with a single E2 entity and a single E1entity may be associated with many E2entities
  • 20. Key Attributes: Primary Key: The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS. Examples: Imagine we have a STUDENTS table that contains a record for each student at a university. The student's unique student ID number would be a good choice for a primary key in the STUDENTS table. The student's first and last name would not be a good choice, as there is always the chance that more than one student might have the same name. Foreign Key:A foreign key is a field in a relational table that matches the primary key column of another table. The foreign key can be used to cross- reference tables Referential Integrity Referential integrity is a database concept that ensures that relationships between tables remain consistent. When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table. It also includes the techniques known as cascading update and cascading delete, which ensure that changes made to the linked table are reflected in the primary table. Referential integrity enforces the following three rules: 1. We may not add a record to the Employees table unless the Managed By attributes points to a valid record in the Managers table.
  • 21. 2. If the primary key for a record in the Managers table changes, all corresponding records in the Employees table must be modified using a cascading update. 3. If a record in the Managers table is deleted, all corresponding records in the Employees table must be deleted using a cascading delete. Importance of Referential Integrity By providing specification of columns within a referencing table that are foreign keys for columns in some other referenced table, referential integrity is a reliable mechanism which prevents accidental database corruptions when doing inserts, updates, and deletes. It states that a row cannot exist in a table with a non-null value for a referencing column if an equal value does not exist in a referenced column. Once we define the employee_number as a foreign key in employee_phone relation, if we try to insert a row with a primary key value that does not exist in employee table, the system will not allow this insertion. The following summarize the benefits of referential integrity: a) Ensure data integrity and consistency base on primary key and foreign key b) Increases development productivity, because it is not necessary to code SQL statements to enforce referential constraints, the Teradata RDBMS automatically enforces referential integrity. Candidate Key: A candidate key is a combination of attributes that can be uniquely used to identify a database record without any extraneous data. Each table may have one or more candidate keys. One of these candidate keys is selected as the table primary key.
  • 22. Check Constraint: A check constraint (also known as table check constraint) is a condition that defines valid data when adding or updating an entry in a table of a relational database. A check constraint is applied to each row in the table. The constraint must be a predicate. It can refer to a single or multiple columns of the table. The result of the predicate can be TRUE, FALSE, or UNKNOWN, depending on the presence of NULLs. If the predicate evaluates to UNKNOWN, then the constraint is not violated and the row can be inserted or updated in the table. Each check constraint has to be defined in the CREATE TABLE or ALTER TABLE statement using the syntax: 1. CREATE TABLE table_name (...,CONSTRAINT constraint_name CHECK ( predicate ), ... ) 2. ALTER TABLE table_name ADD CONSTRAINT constraint_name CHECK ( predicate ) NOT NULL Constraint: A NOT NULL constraint is functionally equivalent to the following check constraint with an IS NOT NULL predicate:CHECK (column IS NOT NULL) Domain Constraints: A domain is defined as the set of all unique values permitted for an attribute. For example, a domain of date is the set of all possible valid dates, a domain of integer is all possible whole numbers, a domain of day-of-week is Monday, Tuesday ... Sunday. This in effect is defining rules for a particular attribute. If it is determined that an attribute is a date then it should be implemented in the database to prevent
  • 23. invalid dates being entered. A domain of possible values should be associated with every attribute. These domain constraints are the most basic form of integrity constraint. They are easy to test for when data is entered. Domain types 1. Attributes may have the same domain, e.g. cname and employee-name. 2. It is not as clear whether bname and cname domains ought to be distinct. 3. At the implementation level, they are both character strings. 4. At the conceptual level, we do not expect customers to have the same names as branches, in general. 5. Strong typing of domains allows us to test for values inserted, and whether queries make sense. Newer systems, particularly object-oriented database systems, offer a rich set of domain types that can be extended easily. Database Users: Users are differentiated by the way they expect to interact with the system -Application programmers – interact with system through DML calls -Sophisticated users – form requests in a database query language -Specialized users – write specialized database applications that do not fit into the traditional data processing framework -Naïve users – invoke one of the permanent application programs that have been written previously l Examples, people accessing database over the web, bank tellers,clerical staff
  • 24. Database Administrator n Coordinates all the activities of the database system; the database administrator has a good understanding of the Enterprise’s information resources and needs. Database administrator's duties include: -Schema definition -Storage structure and access method definition -Schema and physical organization modification -Granting user authority to access the database -Specifying integrity constraints -Acting as liaison with users -Monitoring performance and responding to changes in requirements Keys: -A super key of an entity set is a set of one or more attributes whose values uniquely determine each entity. -A candidate key of an entity set is a minimal super key l Customer_id is candidate key of customer l account_number is candidate key of account -Although several candidate keys may exist, one of the candidate keys is selected to be the primary key.
  • 25. ! " # #$ % &' (# ' ) $ " # #$ $ *& ) #) && ) $ + " # #$ &' (# ' ) $ ,
  • 26. " # #$ $ *#')+
  • 27. " # #$ $ *#') " # #$ - **&
  • 28. " # #$ . ' ' $ # ' ) $ " # #$ / # ) #'# $ ' ) $