Learning Objectives
2
Describe the advantages of using database approach Describe components of database environment Briefly describe the evolution of database systems.
Introduction
3
Over the past two decades, there has been enormous growth in the number and the importance of database applications.
To store, manipulate and retrieve data in nearly every type of organization business, health care, education, government and libraries. Database technology can be used by an individual up to large number of users accessing databases. The knowledge derived from databases can be used:
Introduction ..cont.
4
DataBase Management System (DBMS) is one of the most powerful tools that can be used in building business database application. Provide many features that represent significant advantages over traditional programming methods. Understand the concepts of database design, queries and application building will reduce the time for developing complex applications
Design
Design
Worst: Compensate for poor design and limited SQL with programming.
Program
SQL
SQL
Database:
A collection of data stored in a standardized format, designed to be shared by multiple users. It may be of any size and complexity. Stored representation of objects and events that have meaning and importance in the users environment. Structured data or Unstructured/Multimedia data Data that have been processed in such a way as to increase knowledge of the person who uses the data. Databases today may contain either data or information. Data that describes the properties and context of user data
Data:
Information:
Metadata:
Example of Data
7
Graphical displays turn data into useful information that managers can use for decision making and interpretation
9
Descriptions of the properties or characteristics of the data, including data types, field sizes, allowable values, and data context
10
Inconsistent data
Program-data Dependency
12
13
File description are stored within each application program that access a given file. Consequently, any changes to a file structure requires changes to the file description for all programs that access to the file. It is often difficult to locate all programs affected by such changes and consequently errors are often introduced when making such changes. Each application program must have its own processing routines for reading, inserting, updating and deleting data. Lack of coordination and central control.
Duplicate Data
14
15
Waste of space to have duplicate data Causes more maintenance headaches The biggest problem:
When
data changes in one file, could cause inconsistencies Compromises data integrity.
Programs
Payroll Data Definition File 1 File 2 Benefits Data Definition File A File 2 File C
COBOL File Division 01 Employees 02 ID 02 Name 02 Address 02 Cell Phone 01 Department 02 ID 02 . . . More programs File Division 01 Employees ...
Employee File
112 Davy Jones 999 Elm Street . . . 113 Peter Smith 101 Oak St . . .
Write code to copy employee file and add empty cell phone slot. Find all programs that use employee file.
Modify file definitions. Modify reports (as needed) Recompile, fix new bugs.
18
DBMS
19
A software system that is used to create, maintain, and provide controlled access to user databases. It provides systematic method of creating, updating, storing, and retrieving data in a database. It enables end users and application programmers to share data and it enables data to be shared among multiple application rather than propagated and stored in new files for every new application. It also provides facilities for controlling data access, enforcing data integrity, managing concurrency control, and restoring a database.
DBMS
20
It provides interface between the various database applications for organizational users and database It allows users to share data and to query, access and update the stored data.
21
Graphical model showing high-level entities and its relationships used by the organization. Database technology involving tables (relations) representing entities and primary/foreign keys representing relationships Networks and telecommunications, distributed databases, clientserver and 3-tier architectures Application programs used to perform database activities (create, read, update, and delete) for database users
Relational Databases
Database Applications
One customer may place many orders, but each order is placed by a single customer One-to-many relationship
One order has many order lines; each order line is associated with a single order
One-to-many relationship
One product can be in many order lines, each order line refers to a single product
One-to-many relationship
Therefore, one order involves many products and one product is involved in many orders Many-to-many relationship
Application program functions: inserting new data, updating existing data, deleting existing data, reading data for display
29
30
Two-Tier Client-Server
31
Client manages main business and data processing logic and user interface. Server manages and controls access to database.
Two-Tier Client-Server
32
User interface layer runs on client. Business logic and data processing layer middle tier runs on a server (application server). DBMS stores data required by the middle tier. This tier may be on a separate server (database server).
35
Program-data independence
Enforcement of standards
Such as naming convention, data quality standard and uniform procedures for accessing, updating and protecting data
Database design goal to integrate data files into a single, logical structure.
A database is designed to shared corporate resource. Authorized internal and external users are granted permission to use the database.
Without the knowledge of programming experience can retrieve and display data, even it crosses departmental boundaries.
New development without worry the file design DBMS provides high level productivity tools
CASE Tools computer-aided software engineering Repository centralized storehouse of metadata Database Management System (DBMS) software for managing the database Database storehouse of the data Application Programs software using the data User Interface languages, menus, and other facilities by which users interact with various system components such as CASE tools, DBMS etc. Data/Database Administrators personnel responsible for maintaining the database System Developers personnel responsible for designing databases and software End Users people who use the applications and databases
42
All Data
DBMS
Program1 Queries Program2 Reports
Data independence
Change data definition without changing code Alter code without changing data Move/split data without changing code
Field Name EmployeeID TaxpayerID LastName FirstName ... Phone ... CellPhone
Existing reports, queries, code will all run as before with no changes.
Text
Cellular . . .
DBMS Features/Components
44
Database engine
Storage,
retrieval,
update Enforce business rules Performance and ability to handle large problems
Utilities Security Report writer Forms generator (input screens) Application generator Communications 3GL Interface
DBMS Components
45
All Data
Communication Network
3GL Connector
Program
Product ItemID Description Order 887 Dog food OrderID Customer ODate food 946 Cat
9874 3-3-97 CustomerID Name 9888 3-9-97 1195 Jones 2355 Rojas
Product Customer ItemID Integer, Unique CustomerID Integer, Unique Description Text, 100 char Name Text, 50 char
User Identification Security Access Rights Backup and Recovery
Utilities
All Data
Database Engine Data Dictionary
Query Processor
All Data
Database Engine Data Dictionary
Query Processor
Form Builder
Oracle Ingres Informix (Unix) DB2, SQL/DS (IBM) Access (Microsoft) SQL Server (Microsoft +) Many older (Focus, IMS, ...) Many limited PC (dBASE, Paradox, )
Applications change a lot, but same data. Need for ad hoc questions and queries. Need to reduce development times. Need shared data. Improve quality of data. Enable users to do more development.
Flat files - 1960s - 1980s Hierarchical 1970s - 1990s Network 1970s - 1990s Relational 1980s - present Object-oriented 1990s - present Object-relational 1990s - present Data warehousing 1980s present Web-enabled 1990s - present
Hierarchical Database
54
Customers Customer Order Items Ordered Orders To retrieve data, you must start at the top (customer). When you retrieve a customer, you retrieve all nested data.
Items
Item Description 998 Dog Food 764 Cat Food Quantity 12 11
Network Database
55
Entry point
Customer
Order
Items Ordered
Items
Entry point
Relational Database
56
Customer(CustomerID, Name, Order(OrderID, CustomerID, OrderDate, ItemsOrdered(OrderID, ItemID, Quantity, Items(ItemID, Description, Price,
Data is stored in separate sets of data The tables are not physically connected. Instead, data is linked between column Ex: retrieve order, database can match customer and order by customerID
Object-Oriented Database
57
Order
OrderID CustomerID NewOrder DeleteOrder
Customer
CustomerID Name Add Customer Drop Customer Change Address
OrderItem
OrderID ItemID OrderItem DropOrderItem
Item
ItemID Description New Item Sell Item Buy Item
Reference:
58
Hoffer, J.A, Ramesh, V., Topi, H. 2011. Modern Database Management. 10th Edition, Pearson Education Limited. Post, G.V. 2005. Database Management Systems: Designing and Building Business Application, 3rd Edition, McGraw Hill.
Summary
59
Describe
approach Describe components of database environment Briefly describe the evolution of database systems.