Chapter 1 Fundamentals of Database Management System

59
CHAPTER 1: FUNDAMENTALS OF DATABASE MANAGEMENT SYSTEM DFC2033 Database System

Transcript of Chapter 1 Fundamentals of Database Management System

CHAPTER 1: FUNDAMENTALS OF DATABASE MANAGEMENT SYSTEM

DFC2033 Database System

Course Learning Outcome

CLO1:  Apply  the  fundamentals  concepts  of  database  management  and  rela:onal  data  model  to  create  a  database  based  on  an  organiza:on’s  requirements.  (C3,  PLO1)

Learning Outcome

¨  Define  Database  Management  System  (DBMS)  ¨  Describe  the  proper:es  of  database  ¨  Iden:fy  various  common  DBMS  ¨  Common  features  of  DBMS  ¨  DBMS  architecture  •  Three-­‐scheme    •  Client-­‐server  

 

Terminologies of database ¨  Data

¤  Known facts that can be recorded and have implicit meaning

¨  Database ¤ A collection of related data.

¨  Database System ¤ Composed of 5 major parts: Hardware, Software (DBMS),

People, Procedures and Data

¨  Database Management System (DBMS) ¤ Collection of components that support data acquisition,

dissemination, storage, maintenance, retrieval, and formatting

4

Database Management System (DBMS)

¨  A set of software programs that allows users to create, edit and update data in database files, and store and retrieve data from those database files.

¨  Data in a database can be added, deleted, changed, sorted or searched all using a DBMS.

¨  Example usage of Database System: ¤  Membership and subscription mailing lists

¤  Accounting and bookkeeping information ¤  The data obtained from scientific research

¤  Customer information and Inventory information ¤  Personal records

¤  Library information

5

Database System Environment 6

E Figure 1: Simplified database system environment (ElMasri & Navathe, 2011)

1.  Completeness 2.  Integrity 3.  Flexibility 4.  Efficiency 5.  Usability

Properties of databases

Completeness

¨  Ensures that users can access the data they want includes ad hoc queries, which would not be explicitly given as part of a statement of data requirements.

¨  Database has to support the requirements ¨  It requires the complete understanding of database

structure, relationship and constraint.

¨  Ensures that data is both consistent (no contradictory data) and correct (no invalid data), and ensures that users trust the database.

¨  Database integrity ensures that data entered into the database is accurate, valid, and consistent.

¨  Any applicable integrity constraint and data validation rules must be satisfied before permitting a change to the database.

Integrity

Flexibility

¨  Ensures that a database can evolve (without requiring excessive effort) to satisfy changing user requirements.

¨  Ability to upgrade or change the functionality of database up to the current need.

¨  Ability to support wide area of data types

Efficiency

¨  Ensures that users do not have unduly long response times when accessing data.

¨  The database should be able to perform effectively.

¨  The designer has to choose the right DBMS, the right access path in order to improve the efficiency.

Usability

¨  Ensures that data can be accessed and manipulated in ways which match user requirements.

¨  The database design significantly impacts the quality and usability of the data.

¨  A database design that is not properly normalized will introduce data update anomalies and data errors.

¨  A poorly designed database may place the entire organization at risk due to the incomplete or incorrect information.

A Various Common of DBMS

¨  Server DBMS ¤ Oracle ¤ SQL Server ¤ DB2 ¤ MySQL, Firebird, PostgreSQL (Significant open source

DBMSs)

¨  Desktop DBMS ¤ Microsoft Access ¤ FoxPro, Paradox, Approach, FileMaker Pro

13

Common Features of DBMS 14

Features Description

Database  defini:on   Language  and  graphical  tools  to  define  en::es,  rela:onships,  integrity  constraints,  and  authoriza:on  rights.  

Nonprocedural    access  

Language  and  graphical  tools  to  access  data  without  complicated  coding  

Applica:on  development  

Graphical  tools  to  develop  menus,  data  entry  forms,  and  reports;  data  requirements  for  forms  and  reports  are  specified  using  nonprocedural  access  

Procedural  language  interface  

Language  that  combines  nonprocedural  access  with  full  capabili:es  of  a  programming  language  

Transac:onal  processing  

Control  mechanisms  to  prevent  interference  from  simultaneous  users  and  recover  lost  data  aRer  a  failure  

Database  tuning   Tools  to  monitor  and  improve  database  performance  

Database Definition

¨  Define database structure (schema) before using a database. ¤ Tables and relationships.

¨  The Data Definition Language (DDL) ¤ Define schema or modify the existing one ¤ Cannot be used to manipulate data ¤ Standard DDL: Structured Query Language (SQL)

n SQL CREATE TABLE statement n Graphical tools (User Interface)

Graphical Tool for Database Definition

Relationships

Tabless

Nonprocedural Access

¨  Once a database has been created in a DBMS using a DDL, the user accesses the data using a Data Manipulation Language (DML).

¨  The standard DML is SQL. ¨  Nonprocedural :

¤ A language that allows the user to state what data is needed rather than how it is to be retrieved.

¤  Example : n  SQL : Select name, address, city, state, zip order by zip n  Graphical Tool - SQL Query Wizard

Nonprocedural Access

¨  Query: request for data to answer a question ¨  Indicate what parts of database to retrieve not the

procedural details ¨  Improve productivity and improve accessibility

SQL Query Wizard

Application Development

¨  Graphical tools for developing forms and reports using non-procedural access.

¨  Form: ¤ Formatted document for data entry and display

¨  Report: ¤ Formatted document for display

¨  Use nonprocedural access to specify data requirements of forms and reports

Application Development : Form Generator

Application Development : Report Generator

Procedural Language Interface

¨  A language that combines nonprocedural access with procedural programming.

¨  Combine procedural language with nonprocedural access

¨  Why ¤ Batch processing ¤ Customization and automation ¤ Performance improvement

Transaction Processing

¨  Transaction: ¤  Executing program that forms a logical unit of database

processing ¤  Includes one or more database access operation – insertion,

deletion, modification, retrieval. ¨  Perform scheduling of operations and implements

concurrency control algorithms. ¨  Control simultaneous users ¨  Recover from failures

Database Tuning

¨  Tools to monitor and improve database performance.

¨  Example: ¤ Memory Tuning ¤  I/O Tuning ¤ Application Tuning

Advantages using DBMS 26

¨  Control redundancy in data storage and in development of effort.

¨  Restricting unauthorized of data. ¨  Providing persistent storage for program objects. ¨  Providing backup and recovery services. ¨  Providing multiple interfaces to different classes of

users. ¨  And many more…

Three Level Architecture of DBMS

¨  Mappings among schema levels are needed to transform requests and data. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution.

¨  Also known as ANSI-SPARC Three-level Architecture

27

Three-Level Architecture of DBMS 28

Figure 2: The Three Level Architecture (ElMasri & Navathe, 2011)

Three-Level Architecture of DBMS

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.

29

Three-Level Architecture of DBMS 30

Client-Server Architecture of DBMS 31

Figure 3: Client Server Architecture

Client-Server Architecture of DBMS 32

¨  To improve performance and availability of data, the client–server architecture supports many ways to distribute software and data in a computer network.

¨  Client–server architectures provide a flexible way for DBMSs to interact with computer networks.

¨  The simplest scheme is just to place both software and data on the same computer, Figure 3(a).

¨  In Figure 3(b), the server software and database are located on a remote computer.

¨  In Figure 3(c), the server software and the database are located on multiple remote computers.

33

CROSSWORD PUZZLE

Learning Outcome

¨  Categories  of  DBMS  (including  the  benefits)  ¨  Desktop  databases  ¨  Server  database  

¨  Select  an  appropriate  DBMS  suitable  for  a  given  business  requirements.  

¨  Iden:fy  the  contribu:on  of  database  technology  to  society.  

 

Types of Data Model

•  Network  •  Hierarchical  •  Rela0onal  

•  Object  Oriented  •  En0ty  Rela0onship  •  Func0onal  •  Seman0c  

•  Unify  •  Frame  Memory  

Record Based Data Model

¨  Represent  data  by  using  record  structures  and  hence  are  called  record-­‐based  data  models.    

¨  This  type  of  model  is  used  to  design  the  databases  at  external  or  view  level  as  well  as  logical  or  conceptual  level  and  it  gives  the  details  of  database  designing  and  it  is  tabular  representa:on.  eg.  

n  Rela0onal  model    n  Hierarchical  model  n  Network  model  

37

Rela:onal  Model  

¨  The  rela0onal  model  (RDBMS,  Rela%onal  database  management  system):  The  data  is  stored  in  two-­‐dimensional  tables  (rows  and  columns).  The  data  is  manipulated  based  on  the  rela:onal  theory  of  mathema:cs.      

38

Hierarchical  Model  

¨  The  hierarchical  model:  The  data  is  sorted  hierarchically,  using  a  downward  tree.  This  model  uses  pointers  to  navigate  between  stored  data.  It  was  the  first  DBMS  model.    

   

39

Network  Model  

¨  The  network  model:  like  the  hierarchical  model,  this  model  uses  pointers  toward  stored  data.  However,  it  does  not  necessarily  use  a  downward  tree  structure.      

40

Object Based Data Model

¨  The  object-­‐oriented  model  defines  a  database  in  terms  of  objects,  their  proper:es,  and  their  opera:ons.    

¨  The  most  commonly  object  based  data  models  are  en:ty  rela:on,  seman:c,  Object  oriented,  and  func:onal  data  models.  

41

The Object-Oriented Model ¨  The  object  model  (ODBMS,  object-­‐oriented  database  management  system)  

¨  The  data  is  stored  in  the  form  of  objects,  which  are  structures  called  classes  that  display  the  data  within.  The  fields  are  instances  of  these  classes    

42

Physical Based Data Model

¨  Physical  based  data  model  describes  how  data  is  stored  in  the  computer  by  represen:ng  informa:on  such  as  record  formats,  record  orderings,  and  access  paths.  It  is  the  process  of  choosing  specific  storage  structures  and  access  paths  for  the  database  files  to  achieve  good  performance  for  the  various  database  applica:ons.    

43

Categories of DBMS

¨  Desktop Databases are designed to run on “desktop” (or personal) computers and its offer an inexpensive, simple solution to many less complex data storage and manipulation requirements.

¨  Server Databases offer organizations the ability to manage large amounts of data efficiently and enables many users to access and update the data simultaneously. Although its pricey, a server-based database can provide a comprehensive data management solution.

Categories of DBMS

Desktop Database

Microsoft Access

Fox Pro

FileMaker Pro

Paradox

Lotus

Server Database

Oracle

Microsoft SQL Server

IBM DB2

Open Source :

MySQL, Firebird, PostgresSQL

Benefits of Desktop Database

¨  Easy Management ¤ Simple functionality to modify and maintain the

database ¨  Low Running Cost

¤ No need for extra hardware support ¤ No need to hire expertise

¨  Easy to use ¤ No advance technical knowledge is needed ¤ Programs are normally very intuitive and easy to learn.

Benefits of Server Database

¨  Increase Scalability ¤ any element can be upgraded when needed

¨  Increase Flexibility ¤ new technology can be easily integrated into the

system

¨  Increase Accessibility ¤  server can be accessed remotely and across multiple

platforms

Benefits of Server Database

¨  Increase performance ¤ Different CPU’s process application in parallel ¤ Easier to tune the server machine since the task is only to

perform database processing

¨  Increase Consistency ¤ Centralization - access, resources, and data security are

controlled through the server.

Things to Consider to Select DBMS

1.  Data Model 2.  Number of user 3.  Number of sites 4.  Cost 5.  Purpose

Data Model

¨  A set of concepts to describe the structure of a database and certain constrain that the database should obey (refer data model slide)

¨  Types of data model: ¤  Hierarchy ¤  Network

¤  Relational ¤  Object-oriented

¨  Current commercial database used relational data model.

¨  Object oriented – has been implemented but not had widespread use.

Number of users

¨  Single user – support only one user at one time ¨  Multi user – support multiple use at one time

Number of sites

¨  Centralized ¤ Data is stored at a single computer site. ¤ DBMS can support multiple user, but the DBMS and the

database reside totally at a single computer site.

¨  Distributed ¤ Can have many the actual database and DBMS

software distributed over many sites, connected by a computer network.

Cost

¨  Quite difficult to propose any type of DBMS based on cost which provide different type of services.

¨  Open source product : MySQL, PostgrSQL

Purpose

¨  General Purpose : ¤ Does not include many transactions

¨  Special Purpose: ¤ Require many transaction. ¤ When performance is primary consideration, a special

purpose of DBMS can be design. ¤ Online Transaction Processing (OLTP) system which

support large number of concurrent processing without imposing excessive delay

¤ Example: Airline Reservation System

Comparison between DBMS

DBMS Operating System

Estimated Price

Transaction Support

Interface Max DB size

Oracle Window Mac Unix

$40000 - $12800

Yes GUI SQL

Unlimited

IBM DB2 Window Mac Unix

$25000 - $800000

Yes GUI SQL

512 TB

SQL Server Window

Yes GUI SQL

524258 TB

MySQL Window Linux Mac Solaris Netware

Open Source Yes GUI SQL

256 TB

Microsoft Access

Window Package with Microsoft products

GUI SQL

2G

Group Discussion

¨  You are responsible for selecting a new DBMS product for a group of users in your organization. How should you do about evaluating and selecting the best DBMS product?

The Impact of Information Technology on Work and Society

¨  1969: The Arpanet is introduced, funded by the department of defence.

¨  1970: The first automatic teller machine is introduced.

¨  1971:

¤  The first single chip central processing unit was introduced, the Intel 4004.

¤  The first network e-mail message is sent by Ray Tomlinson of Bolt Boranek and Newman.

¨  1972: Lexitron, Wang and VYTEC introduce Word Processing systems.

¨  1973: The Xerox Paulo Alto Research Centre developed the Alto, an experimental computer that uses a graphical user interface and a mouse.

¨  1978: Ron Rivest, Adi Shamir and Leonard Adelman introduce the RSA cipher as a public key cryptosystem.

¨  1979: The first electronic spreadsheet program is introduced.

¨  1981: IBM introduces its first personal computer with an operating system developed by Microsoft.

¨  1983: The switchover to the TCP\IP protocol marks the beginning of the global Internet.

¨  1985: Microsoft releases the Windows operating system.

¨  1989: The world wide web project is proposed to the European Council for Nuclear Research (CERN).

¨  1990: Windows version 3.0 is released bringing a stable graphical user interface to the IBM Personal Computer.

¨  1993:The Mosaic NCSA is developed by the National Centre for Super-computing Applications.

¨  1995:The first full length feature movie created by a computer is released. Toy Story.

¨  Late 1990’s:The emergence of electronic commerce.

Contribution of Database Technology to Society

¨  Reduced Application Development Time ¤ Less time to create new application using DBMS. ¤ Example: Print report, Retrieve Data

¨  Flexibility ¤ Allow evolutionary changes to the structure of

database without affecting the stored data and existing application.

Contribution of Database Technology to Society

¨  Availability of Up-to-Date Information ¤ Available to all user ¤ As soon as update apply, it is available to all users.

¨  Economic of Scale ¤ DBMS can be shared among various department and

activities thus reduced the data redundancy