Standard vs Custom Battery Packs - Decoding the Power Play
Unit1 dbms
1. By :
Mrs. V. Gowri,
AP/CSE
Unit 1: Introduction to DBMS
2. Set of programs to access the data
DBMS contains information about a particular enterprise
DBMS provides 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
• Manufacturing: production, inventory, orders, supply chain
• Human resources: employee records, salaries, tax deductions
Databases touch all aspects of our lives
Database Management System (DBMS)
Collection of interrelated data
3. In the early days, database applications were
built on top of file systems.
Drawbacks of using file systems to store data:
Data redundancy and inconsistency - duplication of
information in different files.
• Uncontrolled duplication of data is undesirable for
following reasons:
Duplication costs time and money to enter data more than
once.
It takes additional storage space thus again increasing
associated costs. It can be avoided by sharing data files.
It may lead to data inconsistency.
Difficulty in accessing data
Need to write a new program to carry out each new
task.
Purpose of Database System
4. • Data isolation — multiple files and formats.
• When data is isolated in separate files, it is more difficult to
access data and to ensure that data is correct.
• Also, the structure of file depends on application
programming language. Thus the direct incompatibility of
such files makes it difficult to process jointly.
• Integrity problems
Integrity constraints (e.g. account balance > 0) become part
of program code
Hard to add new constraints or change existing ones.
Drawbacks of file systems (cont.)
5. • Atomicity of updates
Failures may leave database in an inconsistent state with
partial updates carried out.
E.g. transfer of funds from one account to another should
either complete or not happen at all.
• Concurrent access by multiple users
Concurrent accessed needed for performance.
Uncontrolled concurrent accesses can lead to inconsistencies
E.g. two people reading a balance and updating it at the same
time.
• Security problems
Database systems offer solutions to all the above
problems
Drawbacks of file systems (cont.)
6. Advantage of DBMS over file system
•No redundant data: Redundancy removed by data normalization. No data
duplication saves storage and improves access time.
•Data Consistency and Integrity:data normalization takes care of the data
redundancy, data inconsistency also been. taken care of as part of it.
•Data Security: It is easier to apply access constraints in database systems
so that only authorized user is able to access the data.
Each user has a different set of access thus data is secured from the issues
such as identity theft, data leaks and misuse of data.
•Privacy: Limited access means privacy of data.
7. •Easy access to data – Database systems manages data in such a way so
that the data is easily accessible with fast response times.
•Easy recovery: Since database systems keeps the backup of data, it is
easier to do a full recovery of data in case of a failure.
•Flexible: Database systems are more flexible than file processing systems
8. Physical level/Internal level : It describes how a
record (e.g., customer) is stored.
Logical level/Conceptual level: It describes data
stored in database, and the relationships among
the data.
type customer = record
name : string;
street : string;
city : integer;
end;
View level/ External Level: Application programs
hide details of data types. Views can also hide
information (e.g., salary) for security purposes.
Levels of Abstraction
9. Views of Data
External
view: User &
Data
Designer
Conceptual
Schema:
Data
Designer
Physical
Storage:
DBA
An architecture for a database system
10. Views of Data
Physical level/Internal level : The physical
representation of the database on the computer.
This level describes how the data is stored in the
database.
• It includes :
Where the data is located
File structures
Access methods
Indexes.
The physical schema is managed by the DBA.
11. Logical level/Conceptual level: The community view of
the database. This level describes what data is stored
in the database and the relationships among the data.
• What are the entities and Relationships in
organization.
• What information these entities and relationships
should store in database.
• What integrity constraints/business rules it should
have?
• It consists of the schemas we have described with
CREATE TABLE statements.
Views of Data
12. View level/ External Level: The users view of the
database. This level describes that part of the
database that is relevant to each user.
• Each external schema is a combination of base
tables and views, tailored to the needs of a single
user.
• It is managed by the data designer and the user.
Views of Data
13. Advantages of DBMS
Control of data redundancy
Data consistency
More information from the same amount of data
Sharing of data
Improved data integrity
Improved security
Enforcement of standards
Economy of scale
Balance of conflicting requirements
Improved data accessibility and responsiveness
Increased productivity
Improved maintenance through data independence
14. Disadvantages of DBMS
Complexity – provision of the functionality we expect
from DBMS makes it extremely complex.
Size – complexity and breadth of functionality makes DBMS
extremely large piece of software.
Cost of DBMSs – it varies significantly depending on
the environment & functionality provided.
Additional hardware costs – to achieve required
performance, it is necessary to procure large memory.
Performance – DBMS is written to be more general, to
cater for many applications rather than just one.
Higher impact of failure – Centralization of resources
increases the vulnerability of the system. Since all users &
applications rely on DBMS, the failure of one component
can bring operations to a halt.
15. Components of the DBMS
1. Hardware – DBMS and the applications require hardware to
run.
• It can range from PCto mainframe or network of
computers.
• It depends on the organization’s requirements and the
DBMS used.
2. Software – It comprises of following :
• DBMS software itself
• Application program
• Operating System including network software
3. Data - Most important component from end-user’s point
of view.
• It acts as a bridge between the machine components
and the human component.
• The database contains both operational data and the
metadata.
16. Components of the DBMS
4. Procedures – It refers to the instructions and rules that
govern the design and use of the database.
• Users of the system require documented procedures
on how to use/run the system.
• It may consists of instructions like
• Log on to the DBMS
• Use a particular DBMS facility or application
program.
• Start and stop DBMS
• Make backup copies of the database
• Handle H/W and S/W failures.
• Change structure of table to improve performance
5. People – i.e USERS
18. Database Users
Users are differentiated by the way they expect to interact with the
system.
1. Application programmers: They are the developers who interact
with the database by means of DML queries. 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.
19. Database Users
2. Sophisticated users : They are database developers, who write SQL
queries to select/insert/delete/update data. They do not use any
application or programs to request the database. They directly
interact with the database by means of query language like SQL.
These users will be scientists, engineers, analysts who thoroughly
study SQL and DBMS to apply the concepts in their requirement. In
short, we can say this category includes designers and developers of
DBMS and SQL.
3. Specialized users: These are also sophisticated users, but they write
special database application programs. They are the developers who
develop the complex programs to the requirement.
20. Database Users
4. Stand-alone Users - These users will have stand –alone
database for their personal use. These kinds of database will
have readymade database packages which will have menus and
graphical interfaces.
5. Naive users: These are the users who use the existing
application to interact with the database. For example, online
library system, ticket booking systems, ATMs etc which has
existing application and users use them to interact with the
database to fulfill their requests.
21. 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
• Monitoring performance and responding to changes in
requirements
22. Instances and Schemas
Similar to types and variables in programming languages
Schema – the logical structure of the database
e.g., the database consists of information about a set of customers and
accounts and the relationship between them)
Analogous to type information of a variable in a program
Physical schema: database design at the physical level
Logical schema: database design at the logical level
Instance – the actual content of the database at a particular
point in time
Analogous to the value of a variable
Physical Data Independence – the ability to modify the
physical schema without changing the logical schema
Applications depend on the logical schema
In general, the interfaces between the various levels and components
should be well defined so that changes in some parts do not seriously
influence others.
23. Storage Manager/Storage Management:
storage manager components include:
Authorization and integrity manager
•Transaction manager
•File manager
•Buffer manager
•Data structures implemented by storage manager.
•Data files: Stored in the database itself.
•Data dictionary: Stores metadata about the structure of the database.
•Indices: Provide fast access to data items.
24. Data Models
concepts for describing and manipulating the
An integrated collection of
following in an organization:
• Data
• Data relationships
• Data semantics
• Data constraints
Facilitate interaction among the designer, the applications programmer, and the
end user
A data model can be thought of as comprising 3components:
• Structural Part – consisting of set of rules according to which databases can
be structured.
• Manipulative part – defining the types of operations that are allowed on the
data (includes insertion, retrieval or updating)
• Set of integrity rules – for ensuring that data is accurate.
25. Instance – the actual content of the database i.e. actual data at a particular
point in time .
• Analogous to the value of a variable.
• The actual data in the database may change very frequently.
Thus many database instances can correspond to the same database
schema.
The schema is sometimes called as intension of the database.
The instance is sometimes called as extension or state of the database.
Schemas and Instances
26. Three-Schema Architecture
• Defines DBMS schemas at three levels:
• Internal schema at the internal level to describe physical
storage structures and access paths. Typically uses a
physical data model.
• Conceptual schema at the conceptual level to describe the
structure and constraints for the whole database for a
community of users. Uses a conceptual or an
implementation data model.
• External schemas at the external level to describe the
various user views. Usually uses the same data model as the
conceptual level.
27. The disjointing of data descriptions from the application programs (or user-
interfaces) that uses the data is called data independence.
Data independence is one of the main advantages of DBMS.
The three-schema architecture provides the concept of data independence,
which means that upper-levels are unaffected by changes to lower-levels.
The interfaces between the various levels and components should be well
defined so that changes in some parts do not seriously influence others.
There are two kinds of data independence.
• Physical Data Independence
• Logical Data Independence
Data Independence
28. Physical Data Independence – the ability to modify the physical
schema without changing the logical schema
• Applications depend on the logical schema
• In general, the interfaces between the various levels and
components should be well defined so that changes in some parts
do not seriously influence others.
Logical Data Independence – the ability to modify the conceptual
schema without changing the application program
• Usually done when logical structure of database is altered.
• Logical data independence is harder to achieve as the application
programs are usually heavily dependent on the logical structure of
the data. An analogy is made to abstract data types in
programming languages.
Types of Data Independence
29. Specification notation for defining the database
schema
◦ E.g.
create table account (
account-number char(10),
balance integer)
DDL compiler generates a set of tables stored in
a data dictionary
Data dictionary contains metadata (i.e., data
about data)
◦ database schema
◦ Data storage and definition language
language in which the storage structure and access
methods used by the database system are specified
Usually an extension of the data definition language
Data Definition Language (DDL)
30. SQL
SQL: widely used non-procedural language
E.g. find the name of the customer with customer-id 192-83-7465
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
E.g. find the balances of all accounts held by the customer with customer-id 192-83-
7465
select account.balance
from depositor, account
where depositor.customer-id = ‘192-83-7465’ and
depositor.account-number = account.account-number
Application programs generally access databases through one of
Language extensions to allow embedded SQL
Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to
a database