DBMS-UNIT 1
Introduction
Database
• By data, it means known facts that can be
  recorded and that have implicit meaning.
• A database is a collection of related data .
• For example, consider the names, telephone
  numbers, and addresses of the people you know.
  You may have recorded this data in an indexed
  address book, or you may have stored it on a
  diskette, using a personal computer and software
  such as DBASE IV or V, Microsoft ACCESS, or
  EXCEL.
• This is a collection of related data with an implicit
  meaning and hence is a database.
Database management
system
• A database management system (DBMS) is a collection
  of programs that enables users to create and maintain a
  database. The DBMS is hence a general-purpose
  software system that facilitates the processes of
  defining, constructing, and manipulating databases for
  various applications. Defining a database involves
  specifying the data types, structures, and constraints for
  the data to be stored in the database. Constructing the
  database is the process of storing the data itself on some
  storage medium that is controlled by the DBMS.
  Manipulating a database includes such functions as
  querying the database to retrieve specific data, updating
  the database to reflect changes in the miniworld, and
  generating reports from the data.
DBMS allows users the
following tasks:
• Data Definition: It is used for creation, modification, and
  removal of definition that defines the organization of data
  in the database.
• Data Updation: It is used for the insertion, modification,
  and deletion of the actual data in the database.
• Data Retrieval: It is used to retrieve the data from the
  database which can be used by applications for various
  purposes.
• User Administration: It is used for registering and
  monitoring users, maintain data integrity, enforcing data
  security, dealing with concurrency control, monitoring
  performance and recovering information corrupted by
  unexpected failure.
Database Systems versus File
Systems
• One way to keep the information on a computer
  is to store it in operating system files.
• To allow users to manipulate the information,
  the system has a number of application
  programs that manipulate the files.
• Keeping organizational information in a file-
  processing system has a number of major
  disadvantages like         Data redundancy and
  inconsistency, Difficulty in accessing data,
  Atomicity problems, Security problems etc
Need of DBMS
• DBMS is useful in the following ways:
• 1. Ease of Accessing Data
In the file system, different files are created for each user
containing which data they can access. Also, in the file system,
for the user to extract data, there is a need for code or
application. DBMS removes redundancy by granting access to
users and decides which and how many parts of data is
accessible to them from the database. Users can get easy
access to data and can also specify the type of data they want
to extract.
• 2. Storage and Management of Data
• Data cannot be stored in the form of objects in the file
  system. The data in the practical world is generally stored in
  the form of objects and not files. So, an application is
  required to map the data into objects for further usage. In
Need of DBMS
3. Easy and Efficient File Management
In the file system, the entire database runs for every query
operation as files are indexed. It takes a lot of time compared
to DBMS, where objects are indexed based on the attribute
of data. The complex management of memory becomes easy
to handle. With this, retrieval of data is faster than the
traditional file system.
4. Avoiding duplicates and Redundancy
Data normalization is used in DBMS to avoid duplicate data.
5. Concurrent Data Accessing
Users can access data simultaneously through different
applications. In the file system, this simultaneous access
leads to inconsistency. DBMS uses the ACID approach to
tackle the issue.
 Advantages of DBMS
• Controls database redundancy: It can control data
  redundancy because it stores all the data in one single
  database file and that recorded data is placed in the
  database.
• Data sharing: In DBMS, the authorized users of an
  organization can share the data among multiple users.
• Easily Maintenance: It can be easily maintainable due to the
  centralized nature of the database system.
• Reduce time: It reduces development time and maintenance
  need.
• Backup: It provides backup and recovery subsystems which
  create automatic backup of data from hardware and software
  failures and restores the data if required.
• multiple user interface: It provides different types of user
  interfaces like graphical user interfaces, application program
  interfaces etc
  Database System Applications
• Banking: For customer information, accounts, and
  loans, and banking transactions.
• Airlines: For reservations and schedule information.
  Airlines were among the first to use databases in a
  geographically distributed manner—terminals situated
  around the world accessed the central database system
  through phone lines and other data networks.
• Universities: For student information, course
  registrations, and grades.
• Telecommunication: For keeping records of calls made,
  generating monthly bills, maintaining balances on
  prepaid calling cards, and storing information about the
  communication networks.
Database System Applications
cntd..
• Finance: For storing information about holdings, sales,
  and purchases of financial instruments such as stocks
  and bonds.
• Sales: For customer, product, and purchase
  information.
• Manufacturing: For management of supply chain and
  for tracking production of items in factories,
  inventories of items in warehouses/stores, and orders
  for items.
• Human resources: For information about employees,
  salaries, payroll taxes and benefits, and for generation
  of paychecks
Data Abstraction
• For the system to be usable, it must retrieve data
  efficiently. The need for efficiency has led
  designers to use complex data structures to
  represent data in the database.
• Since many database-systems users are not
  computer trained, developers hide the complexity
  from users through several levels of abstraction, to
  simplify users’ interactions with the system;
• Physical level
• Logical Level
• View Level
• Physical level. The lowest level of abstraction
  describes how the data are actually stored. The
  physical level describes complex low-level data
  structures in detail.
• Logical level. The next-higher level of abstraction
  describes what data are stored in the database, and
  what relationships exist among those data.
• Database administrators, who must decide what
  information to keep in the database, use the logical
  level of abstraction.
• View level. The highest level of abstraction describes
  only part of the entire database. The view level of
  abstraction exists to simplify users interaction with
  the system. The system may provide many views for
  the same database.
DBMS Architecture
•   Types of DBMS Architecture:
•   1- Tier Architecture
•   2- Tier Architecture
•   3- Tier Architecture
•   1- Tier Architecture:
•   In One- Tier Architecture the database is directly
    available to the user, the user can directly sit on the
    DBMS and use it i.e.; the client, server and the Database
    all present on the same machine. For Example- To learn
    SQL we setup SQL server and the database on the local
    system.
• Sometimes it may be referred as Centralized system with
  single user system.
• Two-tier architecture:
The two-tier architecture is similar to a basic client-
server model. The application at the client end directly
communicates with the database at the server-side. APIs like
ODBC, JDBC are used for this interaction. The server side is
responsible for providing query processing and transaction
management functionalities. On the client-side, the user
interfaces and application programs are run. The application
on the client-side establishes a connection with the server-
side in order to communicate with the DBMS.
An advantage of this type is that maintenance and
understanding are easier, compatible with existing systems.
However, this model gives poor performance when there are
a large number of users.
• Three Tier architecture:
  In this type, there is another layer between the client and the
  server. The client does not directly communicate with the server.
  Instead, it interacts with an application server which further
  communicates with the database system and then the query
  processing and transaction management takes place. This
  intermediate layer acts as a medium for the exchange of partially
  processed data between server and client. This type of
  architecture is used in the case of large web applications.
• Advantages:
   Enhanced scalability due to distributed deployment of
  application servers. Now, individual connections need not be
  made between client and server.
• Data Integrity is maintained. Since there is a middle layer
  between client and server, data corruption can be
  avoided/removed.
• Security is improved. This type of model prevents direct
  interaction of the client with the server thereby reducing access
    Classification of Database
    Management Systems
• Several criteria can be used to classify DBMS.
• Classification Based on Data Model       Relational data model
                                               Object Oriented data model
• Classification Based on User Numbers        Single user system
•                                           Multi User system
• Classification Based on Database Distribution
• Centralized      Distributed       Homogeneous
                                     Heterogeneous
                    Single User system
Multi User system
Centralized System
                     Distributed System