DATABASE
MANAGEMENT
  SYSTEM
                   Data vs. information:
                DATA                          INFORMATION
⚫ Data is a collection of facts, such   ⚫ Information is data that have
  as values or measurements.              been organized and
⚫ It can be numbers, words,               communicated in a coherent
  measurements, observations or           and meaningful manner.
  even just descriptions of things.     ⚫ Data is converted into
                                          information, and information is
                                          converted into knowledge.
                                        ⚫ Knowledge; information
                                          evaluated and organized so that
                                          it can be used purposefully.
Data is also stored in excel sheets.
Is it different from database?
                          DATABASE
A collection of related pieces of data:
⚫ Representing/capturing the information about a real-world enterprise or part
  of an enterprise.
⚫ A database is designed ,built ,populated with data for a specific purpose.
  It has intended group of users and preconceived application.
⚫ Activities of the enterprise are supported by the database and continually
  update the database.
Example: University Database
⚫ Data about students, faculty, courses, laboratories, course
  registration/enrollment etc.
⚫ Purpose: To keep an accurate track of the academic activities of the
  university.
What      is a  DBMS?
 A Database Management System (DBMS) is a software package designed
   to store and manage databases.
DBMS tasks:
⚫ Managing large quantity of structured data
⚫ Efficient retrieval and modification: query processing and optimization
⚫ Sharing data: multiple users use and manipulate data
⚫ Controlling the access to data: maintaining the data integrity
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
Drawbacks of old File methods
⚫ Uncontrolled Duplication: Data redundancy
  ⚫ Wastes space
  ⚫ Hard to update all files
⚫ Inconsistent data
⚫ Inflexibility
  ⚫ Hard to change data
  ⚫ Hard to change programs
⚫ Limited data sharing
⚫ Poor enforcement of standards: Integrity Problems
⚫ Concurrent-access anomalies
⚫ Security Problems
                                                      6
The Advantages of a DBMS
⚫ Minimal data redundancy.
⚫ Data consistency.
⚫ Integration of data.
⚫ Sharing of data.
⚫ Enforcement of standards.
⚫ Ease of application development.
⚫ Uniform security, privacy and integrity.
⚫ Data independence
                     SQL Queries
                           Data
                                             Database Tables
Forms, Reports,
Programs                           Database Server
                  Application Server
                               Users
Developers and                           Application Forms
Administrators
                                                               8
Data      Models
⚫ A data model is a collection of concepts(tools and languages) for describing
  data.
⚫ Data Models define underlying structure of DBMS.
⚫ Contains Description of data, data relationship ,data semantics , data
  integrity constraints.
Data Models cont.
⚫ The relational model of data is the most widely used
  model today.
    Main concept: relation, basically a table with rows
     and columns.
    Every relation has a schema, which describes the
     columns, or fields.
Instances and Schemas
⚫ Schema – A schema is a description of a particular collection of data, using the a
   given data model.
                           Schema is the overall design of database.
  In RDBMS context:
   Schema – table names, attribute names with their data types for each table and
   constraints etc.
                        Name        Roll        Class       Subject
⚫ Data in a database at particular moment is called database state or snapshot.
⚫ It is sometimes called the current state or instances in database. Eg. Entry in student
  table.
⚫ DBMS stores description of schema construct and constraints known as Metadata.
⚫ The Schema is sometimes called Intension and instance is called extension of
  schema
Levels of Abstraction: Three-schema Architecture
⚫ Physical level:
         describes details of how data is stored: files, indices, etc. on the random
         access disk system
         It also typically describes the record layout of files and type of files (hash,
         b-tree, flat).
⚫ Conceptual level(logical):
         Describes data stored in database, and the relationships among the data.
         Hides details of the physical level.
          In the relational model, the conceptual schema presents data as a set of tables
               type customer = record
                      name : string;
     street : string;
     city : integer;
               end;
⚫ View level :
          Each view describes an aspect of the database relevant to a particular
          group of users.
          Portions of stored data should not be seen by some users and implement a
          level of security .
                   For instance, in the context of a library database:
                 Books Purchase Section
                      Issue/Returns Management Section
Three Level Architecture
Roles for people
⚫ Application programmers – interact with system through DML calls
⚫ Sophisticated users – form requests in a database query language
⚫ Specialized users – write specialized database applications that do not fit into
  the traditional data processing framework
⚫ Naive users – invoke one of the permanent application programs that have
  been written previously
    ⚫ E.g. people accessing database over the web, bank tellers, clerical staff
DBA (Database Administrator)
⚫ Designing the logical schema
⚫ Creating the structure of the entire database
⚫ Monitor usage and create necessary index structures to speedup query
  execution
⚫ Grant / Revoke data access permissions to other users etc
Data    Independence
 Capacity to change schema at one level of database system
  without having to change schema at next higher level.
⚫ Physical data independence: The ability to modify
  physical level schema without affecting the logical or view
  level schema.
  Performance tuning – modification at physical level
  creating a new index etc.
Logical data independence: The ability to change the
logical level scheme without affecting the view level schemes
or application programs
Adding a new attribute to some relation
⚫ no need to change the programs or views that don’t require to
  use the new attribute
Deleting an attribute
⚫ no need to change the programs or views that use the remaining
  data
 Summary
⚫ DBMS used to maintain, query large datasets.
⚫ Benefits include recovery from system crashes, concurrent
  access, quick application development, data integrity and
  security.
⚫ Levels of abstraction give data independence.
⚫ A DBMS typically has a layered architecture.