Introduction to Database Management Systems by joI8Pj

VIEWS: 19 PAGES: 56

									Introduction to
Database Management
Systems

   Dr. Rania Elgohary
       FCIS, ASU


                        1
Motivation
 Organisations are increasingly aware of the
  importance of information in the solution of
  their problems.
 Because of decreasing cost of data storage,
  organisations store increasing quantities of
  data.
 This data must be managed in the most
  efficient and effective manner.


                                                 2
3
Chapter       1


Databases and Database Users



                               4
Chapter      2


 Database System Concepts
      and Architecture


                            5
Chapter      3


  Data Modeling Using the
    Entity-Relationship
        (ER) Model


                            6
Chapter      4


     The Enhanced
    Entity-Relationship
      (EER) Model


                          7
   Chapter          5


The Relational Data Model and Relational
          Database Constraints


                                           8
Chapter      6


  The Relational Algebra
  and Relational Calculus


                            9
Chapter      7


   Relational Database
    Design by ER- and
 EER-to-Relational Mapping


                             10
Chapter        8


     SQL-99:Schema
   Definition, Constraints,
    Queries, and Views

                              11
Chapter      9


     Introduction to SQL
  Programming Techniques


                           12
Chapter       10


  Functional Dependencies
      and Normalization
  for Relational Databases


                             13
  Chapter        11


     Relational Database Design
Algorithms and Further Dependencies


                                      14
Chapter       12


  Practical Database Design
      Methodology and
    Use of UML Diagrams


                              15
Chapter       1


Databases and Database Users



                               16
     What is a Database?
 Traditionally
    Computerised record-keeping system

 More recent
   Multimedia databases
      Pictures, Video clips, Movies, Sound

   Geographic Information Systems (GIS)
   Data Warehouses
   Real-time and Active Databases


 World Wide Web
   Text and Image Search Engines
                                              17
Basic Definitions
 Database:
    A collection of related data.
 Data:
    Known facts that can be recorded and have an implicit
     meaning.
 Database Management System (DBMS):
    A software package/ system to facilitate the creation and
     maintenance of a computerized database.
 Database System:
    The DBMS software together with the data itself.
     Sometimes, the applications are also included.




                                                                 18
    Role of a Database

 Information provider
 Service provider
 Information store
   Size   reduction
 Information retriever



                          19
Everyday usage of databases
 Small single user databases on home machine:
    Very user friendly but also very limited
    e.g. Microsoft Access

 Everyday usage of large databases:
    Normally through custom-built user-friendly interfaces.
     e.g. GUI, Forms, Special-purpose
 Aim of course:
    Understanding how large database systems work,
     their design, building and operation, and the
     provision of the user interfaces


                                                           20
Typical DBMS Functionality
 Define a particular database in terms of its data
  types, structures, and constraints
 Construct or Load the initial database contents on a
  secondary storage medium
 Manipulating the database:
      Retrieval: Querying, generating reports
      Modification: Insertions, deletions and updates to its
       content
      Accessing the database through Web applications
 Processing and Sharing by a set of concurrent users
  and application programs – yet, keeping all data valid
  and consistent                                        21
Typical DBMS Functionality
 Other features:
     Protection or Security measures to prevent
      unauthorized access
     “Active” processing to take internal actions on
      data
     Presentation and Visualization of data
     Maintaining the database and associated
      programs over the lifetime of the database
      application
          Called database, software, and system
           maintenance
                                                        22
Examples of a Traditional Database
Application
Suppose we are building a system
to store the information about:
 students
 courses
 professors
 who takes what, who teaches what




                                     23
Example of a Database
(with a Conceptual Data Model)
 Mini-world for the example:
     Part of a UNIVERSITY environment.
 Some mini-world entities:
     STUDENTs
     COURSEs
     SECTIONs (of COURSEs)
     (academic) DEPARTMENTs
     INSTRUCTORs


                                          24
Can we do it without a DBMS ?
Sure we can! Start by storing the data in files:

students.txt   courses.txt       professors.txt




Now write C or Java programs to implement
 specific tasks

                                                   25
Doing it without a DBMS...
 Enroll “student1” in “CSE444”:
    Write a C/Java program to do the following:



                  Read ‘students.txt’
                  Read ‘courses.txt’
        Find&update the record “Mary Johnson”
           Find&update the record “CSE444”
                 Write “students.txt”
                  Write “courses.txt”




                                                  26
Problems without an DBMS...
 System crashes: ex craches in:
  Write “students.txt”
   Write “courses.txt
     What is the problem ?
 Large data sets (say 50GB)
     Why is this a problem ?
 Simultaneous access by many users
     Lock students.txt – what is the problem ?


                                                  27
Example of a Database
(with a Conceptual Data Model)
 Some mini-world relationships:
    SECTIONs are of specific COURSEs
    STUDENTs take SECTIONs
    COURSEs have prerequisite COURSEs
    INSTRUCTORs teach SECTIONs
    COURSEs are offered by DEPARTMENTs
    STUDENTs major in DEPARTMENTs



 Note: The above entities and relationships are
  typically expressed in a conceptual data model, such
  as the ENTITY-RELATIONSHIP data model (see
  Chapters 3, 4)                                      28
Example of a simple database




                               29
Benefits of the Database Approach
 Data can be shared
 Redundancy can be reduced
 Transaction support possible
 Integrity can be maintained
 Security can be enforced
 Conflicting requirements balanced
 Enforced standards
 Data independence: Physical and logical

                                            30
The Database Approach
 Organizations must have access to
  operational data that is
     accurate
          timely
          convenient
     up-to-date
     secure but available
 As control decentralizes in an organization,
  there is a danger that data management
  decentralizes as well.
                                                 31
Dangers of Decentralized Data
Management
 Redundancy
 Inconsistency
 Incompatibility
      Different formats
      Different constraints
      Different models of the data
 Inaccuracy
 Insecurity
 Non-accountability
 Inflexibility                       32
Integration and Sharing
 Data should be
     integrated
          the database can be regarded as a unification of
           several otherwise distinct data files
     shared
          individual pieces of data in the database can be
           shared among several different users




                                                              33
Data Management
 Objective
     Model a part of the world of the real world
      accurately and efficiently to give user useful
      data
 Requirements
     Flexibility
     Accuracy
     Reliability
     Accessibility
     Efficiency
                                                       34
Definition of a Database
 A database (DB) is a collection of interrelated
  computer files, whose data contents and
  structure are described in a data dictionary
  and which is under the control of a database
  management system (DBMS)




                                                 35
Main Characteristics of the
Database Approach
 Self-describing nature of a database system:
    A DBMS catalog stores the description of a particular
     database (e.g. data structures, types, and constraints)
    The description is called meta-data.
    This allows the DBMS software to work with different
     database applications.
 Insulation between programs and data:
    Called program-data independence.
    Allows changing data structures and storage
     organization without having to change the DBMS
     access programs.

                                                               36
Example of a simplified database
catalog




                                   37
Main Characteristics of the
Database Approach (continued)
 Data Abstraction:
     A data model is used to hide storage details
      and present the users with a conceptual view
      of the database.
     Programs refer to the data model constructs
      rather than data storage details
 Support of multiple views of the data:
     Each user may see a different view of the
      database, which describes only the data of
      interest to that user.
                                                     38
Main Characteristics of the
Database Approach (continued)
 Sharing of data and multi-user transaction
  processing:
      Allowing a set of concurrent users to retrieve from
       and to update the database.
      Concurrency control within the DBMS guarantees that
       each transaction is correctly executed or aborted
      Recovery subsystem ensures each completed
       transaction has its effect permanently recorded in the
       database
      OLTP (Online Transaction Processing) is a major part
       of database applications. This allows hundreds of
       concurrent transactions to execute per second.
                                                                39
Database Systems
 The big commercial database vendors:
     Oracle
     IBM (with DB2)
     Microsoft (SQL Server)
     Sybase
 Some free database systems (Unix) :
     Postgres
     MySQL
     Predator
                                         40
Databases and the Web
 Accessing databases through web interfaces
     Java programming interface (JDBC)
     Embedding into HTML pages (JSP)
     Access through http protocol (Web Services)
 Using Web document formats for data
  definition and manipulation
     XML, Xquery, Xpath
     XML databases and messaging systems


                                                    41
Other Trends in Databases
 Industrial
      Object-relational databases
      Main memory database systems
      Data warehousing and mining
 Research
      Peer-to-peer data management
      Stream data management
      Mobile data management


                                      42
Database Management Systems
 A database management system is a
 collection of programs that carry out activities
 on a database, including
     setting up storage structures
     loading data
     accepting and performing updates
     accepting data requests from users and
      programs.


                                                43
Functions of a DBMS
 A good DBMS performs the following
 functions
     maintain data dictionary
     support multiple views of data
     enforce integrity constraints
     enforce access constraints
     support concurrency control
     support backup and recovery procedures
     support logical transactions

                                               44
Advantages of Using a DBMS
  All applications access a common DB. So,
   details related to data storage and access
   are removed from programs and users.
  Hence
      less redundancy
      less risk of inconsistency
      maintenance of data integrity
      application of access restrictions
      balance between different requirements
      data independence                        45
Layered Structure of a Database
 We can regard a database as having a
 layered structure
 ------------------------------
     External Schema
 ------------------------------

 ------------------------------
     Conceptual Schema
 ------------------------------

 ------------------------------
     Internal Schema
                                         46
 ------------------------------
Schemas and Instances
 A schema is the overall design of the
  database. It describes the data contents,
  structure and some other aspects of the
  database




                                              47
Data Independence:
External schema
 Different users often need different views of
  the data.
 Example:
     Bursar needs to have access to financial
      information on a student
     Head of Department needs access to
      academic information.
 An external schema is a description of part of
  the DB as seen by an application
  programmer or a user
                                                  48
Conceptual Schema
 Representation of the logical structure of the
  information content of the DB.
 Abstracts away from the actual physical
  storage.




                                                   49
Internal Schema
 The internal schema describes the data as it
  is physically stored.
 For example,
      record structure
      types of fields in a record
      existence of primary and secondary indexes




                                                    50
51
52
Database Users
 Users may be divided into
     Those who actually use and control the
      database content, and those who design,
      develop and maintain database applications
      (called “Actors on the Scene”), and
     Those who design and develop the DBMS
      software and related tools, and the computer
      systems operators (called “Workers Behind
      the Scene”).


                                                     53
Database Users
 Actors on the scene
     Database administrators:
          Responsible for authorizing access to the
           database, for coordinating and monitoring its use,
           acquiring software and hardware resources,
           controlling its use and monitoring efficiency of
           operations.
     Database Designers:
          Responsible to define the content, the structure,
           the constraints, and functions or transactions
           against the database. They must communicate
           with the end-users and understand their needs.
                                                               54
Categories of End-users
 Actors on the scene (continued)
   End-users: They use the data for queries,
    reports and some of them update the
    database content.




                                                55
Categories of End-users
(continued)
       Sophisticated:
          These include business analysts, scientists,
           engineers, others thoroughly familiar with the system
           capabilities.
          Many use tools in the form of software packages that
           work closely with the stored database.
       Stand-alone:
          Mostly maintain personal databases using ready-to-
           use packaged applications.
          An example is a tax program user that creates its
           own internal database.
          Another example is a user that maintains an address
           book
                                                               56

								
To top