DBMS60
DBMS60
• Durability: These are computer applications and hence data is less prone
to physical damage.
• Scalability: Easier to search, insert and modify records as compared to
book ledgers
• Security: Can be password-protected
• Ease of Use: Computer applications are used to search and manipulate
records in the spreadsheets leading to reduction in manpower
• Consistency: Not guaranteed but spreadsheets are less prone to
mistakes than registers.
Level of abstraction
View level
NOTE
▪ Physical Data Independence – the
ability to modify the physical schema
without changing the logical schema
Logical level
▪ Logical Data Independence- the ability
to modify the logical level without
changing the view level.
Physical level
Schema
Instance
Data Models
• Relational model (data stored in various tables)
• A collection of tools for describing
• Entity-Relationship data model
◦ Data • Object-based data models (flat, atomic values)
◦ Data relationships • Network model
◦ Data semantics • Hierarchical model
• Recent models for Semi-structured or
◦ Data constraints
Unstructured data
Relational algebra
Commercial SQL
DDL(data definition language) DML (data manipulation language)
• Specification notation to define the • Language to manipulate and access data
database schema
• Ex- create table, drop table, alter table • Ex- insert, update, delete
• It generates a set of table templates
stored in a data dictionary • It is also known as query language
• interface between the • Parsing and translation A transaction is a collection of operations that
low-level data stored in • Optimization performs a single logical function in a
the database and the • Evaluation database application
application programs and
• Transaction-management component:
queries submitted to the It helps in estimating the cost
ensures that the database remains in a
system. of operation.
consistent state despite system failures
and transaction failures.
• Interacts with OS file
• Concurrency-control manager: controls
manager.
the interaction among the concurrent
transactions, to ensure the consistency
• Stores, retrieves and
of the database.
updates data.
WEEK 2 DBMS
Super key
Secondary
Any key which identifies a tuple
simple key uniquely with just a single attribute. key
Super key: set of one or more attributes which can uniquely identify a
tuple. It should have the primary key and then it can include the keys
which doesn’t determine uniqueness. Example: {empID},
{empID,empName},{empID,empName,empPhone}
SET DIFFERENCE- example r-s takes the tuples of r which are not present in s
WHERE Clause
Specifies conditions to retrieve data
WHERE i.course_id=c.course_id and i.dept_name='Biology' and
salary>40000
STRING OPERATION
• LIKE - Uses the pattern that are described in like condition and matches with the
attribute
• % - matches any substring %abc%
%abc
abc%
Some Clause
All Clause
This should
exist(be true) for
the above query
to execute
Will show all courses which were taught in
2009 and 2010 in fall and spring semester.
NOT EXISTS clause
WITH clause
Students table
Strong entity set with composite key and multivalued attribute
It is better to
decompose these
kinds of tables
into multiple
tables to avoid
redundancy and
inconsistency
Strong entity set with composite key, multivalued attribute and derived
attribute
The primary key of
one becomes a
attribute of many.
Course_num(primary
key of one) becomes
attribute of
student(many)
Ternary relationship
DBMS Week 5
Extraneous attribute
DBMS Week 6
Week 8 DBMS
The root node is said to be at Level 0 and
the children of the root node are at
Level 1 until and unless root is specified to
exist at level 1