15IT302J DBMS Sessionwise Unit I 1
15IT302J DBMS Sessionwise Unit I 1
l
- 3 , p – 2, c - 4
15IT302J
Outline
DBMS
Examples
Purpose of DB
File Processing System
View of Data
Level of Abstraction
Instances and Schema
Database Management System
(DBMS)
Database
Collection of data, Primary Goal : store and retrieve database information that is both convenient and efficient.
DBMS contains information about a particular enterprise
Collection of interrelated data
Set of programs to access the data
Database Applications:
Banking: 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
Databases can be very large.
Databases touch all aspects of our lives
University Database Example
Application program examples
Add new students, instructors, and courses
Register students for courses, and generate class
rosters
Assign grades to students, compute grade point
averages (GPA) and generate transcripts
In the early days, database applications were
built directly on top of file systems
Purpose of database systems
In need of handling computerized management of
commercial data.
Allow users to manipulate the information.
Have to be written to handle new rules
Acquires more files and more application programs
Drawbacks of using file systems to store data
Atomicity of updates
Failures may leave database in an inconsistent state with partial
Buffer manager – fetch data from disk storage into main memory
Client-server
Parallel (multi-processor)
Distributed
Database system structure
Database systems can be centralized, or client-server, where one server
machine executes work on behalf of multiple client machines.
Database systems can also be designed to exploit parallel computer
architectures. Distributed databases span multiple geographically
separated machines.
Structure of Modern Computer System.
Query processing using parallel processing
Distributed Database
Ensure atomicity & concurrency control of transactions that execute at multiple
sites
Distributed query processing and directory systems
Database applications are usually partitioned into two or three parts,
Two-tier architecture, the application resides at the client machine,
Three-tier architecture, the client machine acts as front end and no direct
database calls.
History of Database Systems
1950s and early 1960s:
Data processing using magnetic tapes for storage
Tapes provided only sequential access
Punched cards for input
Late 1960s and 1970s:
Hard disks allowed direct access to data
Network and hierarchical data models in widespread use
Ted Codd defines the relational data model
Would win the ACM Turing Award for this work
IBM Research begins System R prototype
UC Berkeley begins Ingres prototype
High-performance (for the era) transaction processing
History (cont.)
1980s:
Research relational prototypes evolve into commercial systems
SQL becomes industrial standard
Parallel and distributed database systems
Object-oriented database systems
1990s:
Large decision support and data-mining applications
Large multi-terabyte data warehouses
Emergence of Web commerce
Early 2000s:
XML and XQuery standards
Automated database administration
Later 2000s:
Giant data storage systems
Google BigTable, Yahoo PNuts, Amazon, ..
Entity relationship model
Session 5
outline
ER model
Entity Sets
Attribute Type
Relationship Sets
Constraints
Keys
Entity relationship model
Represents the logical structure of DB, serve as
semantic data model
Useful in mapping the meaning and interactions of
real world onto conceptual schema.
Basic concepts
Entity Sets
Relationship sets
Constraints
Keys
Entity sets
Entity: A thing or object in real world.
Ex: Each student in a department is an entity.
Stud Id= 101 identify a unique person in the department.
Entity Set: set of entities of same type.
Ex: set of all student details - student entity set.
Attributes: descriptive properties possessed by each member of entity
set
Ex: Stud_id, Stud_name, City
101 is value of the attribute Stud_id
Domain / Value set: set of permitted values for each attributes.
Ex: Stud_name is set of all strings of certain length
Attribute types
Simple attribute – attributes cant be divided
into subparts.
Ex: Firstname, MiddleName, LastName of
students
Composite attribute – attributes can be
divided into subparts
Ex: StudName can be divided into Firstname,
LastName
Single-valued attribute – have single value
for particular entity
Ex: StudId
Multivalued attribute – can have more than
single value for a particular entity
Ex: StudPhoneNo.
Derived attribute – value can be derived from
value of other related attribute
Ex: Value of Age attribute can be derived from
DOB attribute
Relationship sets
Relationship : association among entities.
Ex: Relation between Devi and DBMS.
Relationship set: set of relationships of same type.
Ex Relationship set Coursestaken
Relationship Instance: association between entities that is modeled
Ex: 101 from Goa taken DBMS.
Descriptive Attribute – attribute of relationship set
Ex: DateofEnrollment in relationship set Coursestaken
Participate: An entity E1,E2 ..En Participate in Relationship set R.
Entity Role: Function that entity plays in relationship
Recursive Relationship set
Binary Relationship set
Constraints
Mapping Cardinalities
One to One
One to Many
Many to One
Many to Many
Participation Constraints
Total
Partial
Constraints
1:1 1:M M:1 M:M
B Total with A
A Partial with B
keys
Keys – used to identify a set of attributes that can identify entities
from each others.
Entity sets
Super Key: set of one or more attributes (collectively) identify
uniquely an entity in entity set. Ex: <StudId>, <StudName,DOB>,
<StudId,City>, <StudId, City, State>
Candidate keys: a superkey which has no propersubset or minimal
superkey. Ex: StudId
Primary Key: DB designer uses a candidate key for identification of
entity uniquiely. Ex: StudId
Relationship sets
Relationship sets contains Primary key of all entity set involves in
relationship
End of Unit 1
Session 5