The goals of a DBMS :
- The primary goal of a DBMS is to provide an environment that is both convient and efficient for people in retrieving and storing information
- Database systems are designed to manage large bodies of information.Management of dta involves both defining structures for storage of information and providing mechanisms for manipulation of information
- The database system must ensure the safety and security of the information stored, despire system crashes or attempt at unauthorized access
- The system must avoid possible anomalous results if data are to be shared among several users
The Database System Applications :
1. Banking :Fro customer information, accounts, loans, banking transactions
2.Airlines/Railways/Road Transport :For ticket reservation, schedules and routes
3.Universities :For student information, courses and grades
4.Credit card transaction :For purchases on credit card, monthly statement generation
5.Telecommunication :For keeping records of call made, generating monthly bills, maintaining balances on prepaid calling cards, storing information about the communication networks
6.Finance :For storing information about holdings, sales, and purchases of financial instruments such as stocks and bonds.
7.Sales :Fro customer, product and purchase information
8.On-line retailers :For sale data model above plus on-line order tracking, generation of recommendation lists and maintenance of on-line product evaluation
9.Manufacturing :For management of supply chains and for tracking production of items in factories, inventories of items in warehouse/stores and order for items
10.Human resources :For information about employees, salaries, payroll taxes and benefits and for generation of pay checks
11.Internet :Internet is the major repository of database.
The purpose of Database System(Database management System Vs File Systems) :
1.Data redundancy and inconsistency :- Multiple file formats, duplication of information in different files leading to a higher storage and access cost.
2.Difficulty in accessing data :-Need to write a new program to carry out each new task
3.Data Isolation :-Because data are scattered in various files with different formats, writing new applications programs to retrieve the appropriate data is difficult
4.Integrity Problems :Integrity constraints (e.g account balance > 0) become part of program code rather than being stated explicitly
.-hard to add new constraints or change existing ones
5.Automacity problem :-failures may leave database in an inconsistent state with partial updates carried out.
6.Concurrent access anomalies :-Needed for system performance and faster response
.-Uncontrolled concurrent accesses can lead to inconsistencies.E.g.two people reading a balance and updating it at the same time - so supervision is needed
7.Security Problems :-Not every user of the database system should be able to access all the data.This is hard to provide user access to some data, but not all.
The types of data abstraction :
1.Physical level :The lowest level of abstration describe how data are actually stored.it describes complex low-level data structures in detail.
Logical level :The next higher level of abstraction describes what data stored in database, and what relationships exist among those data.
3.View level :The highest level of abstraction describes only part of the entire database.Although the logical level uses simpler structures, complexity remains because of the variety of the information stored in a large database.
- Databases change over time as information is inserted and deleted.The collection of information stored in the database at a particular moment is called an instance of the database.
- While executing, each variable of a programming language has a particular value at a given instant
- The values of the variable in a programming a point in time correspond to an instance of the database schema
- The overall design of the database is called the database schema
- Schemas are changed infrequently , if at all.this correspondsto declaration of a programming language
- Schemas are :
1.Physical schema :Describes the database design at physical level
2.Logical schema :Describes the database design at logical level
3.View schema :Describes the database design at view level
Physical data Independence :
- The ability to modify the physical schema without changing the logical schema is called physical data independence
- 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
The Data Model :
A data model is a collection of conceptual tools for describing data, data relationship data semantics and consistency constraints.A data model provides a way to describe the design of a database at the physical, logical and view level.
Data model can be classified into following different categories :
1.Relational Model :
This is lower level model.It uses a collection of tables to represent both data and relationships among those data.
- Each table has multiple columns, and each column has a unique name.
- The ralational model is a example of a record base model
- The relational model is the most widely used data model and a vast majority of current database systems are based on the relational model
2.Entity-Relationship Model :This is a higher level data model.It is based on a preception of a real world that consists of a collection of basic objects, called entity relationship model.
Data Definition Language(DDL) :
A database schema is specified by a set of definitions expressed by a special language called a data definition language.The DDL is also used to specify additional property of data.
For instance :The following statement in the SQL language defines the account table :
create table account( account_number char(10), balance number(12,2) );
Data Manipulation Language(DML) :
DML is a language that enables users to access or manipulate data as organized appropriate data model.The types of accesses are :
- i) The retrieval of information stored in the database - Query
- ii) The insertion of new information into the database - insert
- iii) The deletion of information from the database - delete
- iv) The modification of information stored in the database - update
Classes of DML :There are basically two types :
1.Procedural DMLs -user specifies what data are required and how to get computer the data.e.g.Relational Algebra
2.Nonprocedural DMLs(Declarative DMLs) -user specifies what data required without specifying how to get or compute the data.e.g SQL
Transaction Management :
A transaction is a collection of operations that performs a single logical function database application.e.g., deposit, withdrawal, transfer between accounts.
- ACID properties of Transaction
- A - Atomicity
- C - Consistency
- I - Isolation
- D - Durability
Transaction management componentensures that the database remains in a consistent(Correct) state despire failures (e.g., power failures and operating system crashes) and transaction failures.
Concurrency-control managercontrols the interaction among the concurrent transactions, to ensure the consistency of the database.
The Storage Management :
The storage manager is responsible to the following tasks :
- i) Interaction with the file manager (OS)
- ii) Efficient storage, retrieval and updating of data
- The storage manager components include:
1.Authorization and integrity manager :Tests integrity constraints and checks the authority of users to access data.
2.Transaction manager :ensures consistency of the DB despite system failures.
3.File manager :Allocation of space + dta structure used to represent information store in the disk.
4.Buffer manager :Responsible for fetching data disk storage into main memory and deciding what data to cache in the main memory.
- The storage manager implements several data structures as part of the physical system implementation :
1.Data files :Which store the database itself(relations)
2.Data dictionary :Stores the metadata about the stucture of the database(sometimes called catalog)
3.Indices :Provide fast access to data items.
The types of Database users :
1.Naive Users :are unsophisticated users who interact with the system by invoking of the permanent application programs that have been written previously
2.Application Programmers :are computer professionals who write application programs.Rapid application development(RAD) tools are tools that enable application programmer to construct forms and reports with minimal programming effect.
3.Sophisticated users :Interact with the system without writting programs.
4.Specialized users :are sophisticated users who write specialized database applications what do not fit into the traditional data processing framework.e.gcomputer aided design systems, knowledge base and expert systems and environment modeling systems uses complex data types.
The about of Database Administrator(DBA) :
One of the main reasons for using DBMS is to have central control both data and the programs that access that data.A person who has such central over the system is called database administrator(DBA)
The functions of a database administrator(DBA) include :
Schema definition :The DBA creates the original database schema by executing a set data definition statements in the DDL.
Storage Structure and access method definition :File organization(Sequential, heap, hash, B+ tree), organization of records in a file (fixed length or variable length), index definition(ordered index, hash index).
Schema and physical-organization modification :The DBA carries out changes to the schema and physical organization to reflect the changing needs of the organization, or alter the physical organization to improve the performance.
Granting of authorization for data access :By granting different types of authorization, the DBA can regulate which parts of the database various users can access.
Specifying integrity constraints :The DBA implements key declaration (primary key, foreign key), trigger, assertion, business rules of the organization.
The Database System Architecture :