Documente Academic
Documente Profesional
Documente Cultură
Lecture 1
2 I N T R O D U C T I O N T O D ATA B A S E S
Objectives
3
Some brief definitions and common uses of database systems. Characteristics and problems of file-based systems. Meaning of the term database and Database Management System
(DBMS).
Components of DBMS Environment Roles in the Database Environment Advantages and disadvantages of DBMSs
Some Definitions
4
Database
Database Application
A program that interacts with the database at some point in its execution.
Database System
Taking out insurance A broker accesses several insurance company databases Using the Internet Bookstore to buy books and purchase by using a credit card (both uses DB) Studying at university Student database
File-Based Systems
7
File-Based Systems
8
Separation and isolation of data Each program maintains its own set of data. Users of one program may be unaware of potentially useful data held by other programs. Duplication of data Same data is held by different programs. Wasted space and potentially different values and/or different formats for the same item. It costs time & money to enter data more than once. Loss of data integrity.
Dr. Said Mirza Pahlevi, M.Eng. Pascasarjana STMIK Nusa Mandiri
File structure is defined in the program code. It is difficult to change the file structure. Need to change both the file and accessing programs. e.g., change PropertyForRent address field from 40 to 41. Creating one-off program & modify all accessing programs
Programs are written in different languages (e.g., COBOL & C), and so cannot easily access each others files.
Programs are written to satisfy particular functions. Any new requirement needs a new program.
Database Approach
11
Definition of data was embedded in application programs, rather than being stored separately and independently. No control over access and manipulation of data beyond that imposed by application programs.
Database
12
Shared large repository of data with metadata (self-describing). This enables programdata independence.
organizations information.
Entities: branch and staff. Property: branchNo and staffNo. Relationship: a branch has staff.
A computer program that interacts with database by issuing an appropriate request (SQL statement) to the DBMS.
Figure 1.5
DBMS Functionalities
15
Permits specification of data types, structures and any data constraints. All specifications are stored in the database.
DBMS Functionalities
16
Views
17
database.
e.g., contract department wants to see for a rental property shown in Figure 1.5
Views - Benefits
18
Reduce complexity.
Hardware
Can range from a PC to a network of computers. Client-server architecture (backend & frontend).
Software
DBMS, operating system, network software (if necessary) and also the application programs (3GL such as Java, VB etc. & 4GL such as SQL embedded in 3GL).
Pascasarjana STMIK Nusa Mandiri
Data
Operational data used by the organization and a description of this data called the schema.
Procedures
Instructions and rules that should be applied to the design and use of the database and DBMS. Log in, start/stop DBMS, backup etc.
People
Dr. Said Mirza Pahlevi, M.Eng.
Physical realization of DB (physical DB design & implementation, security and integrity control etc.)
Conceptual/logical DB
Identifying
the data (entities & attributes), and their relationships & constraints Understand the data and business rules (main characteristics of the data as viewed by the organization)
Physical DB design
Deciding
how the logical DB design is to be physically realized e.g., mapping logical DB design into a set of tables and integrity constraints
Dr. Said Mirza Pahlevi, M.Eng. Pascasarjana STMIK Nusa Mandiri
Application Programmers
Creating program to access the DB (retrieve, insert, update & delete data)
End Users
Nave: unaware of the DBMS Sophisticated: familiar with the structure of the database and the provided database facilities
Advantages of DBMSs
25
Data consistency
Data integration
Sharing of data
Advantages of DBMSs
26
Improved data integrity (constraints) Validity and consistency of stored data Improved security Usernames and passwords for authorization Access by operation types: retrieval, insert, update & delete Enforcement of standards Data formats, naming conventions, document standards, update procedures and access rules Economy of scale Combining operational data into one database and managing them can result in cost savings
Dr. Said Mirza Pahlevi, M.Eng.
Advantages of DBMSs
27
The database is under control of a DBA that can make best decisions base on user needs
The integrated data is directly accessible to the end users by using program, query language and report writers
Increased productivity
DBMS provides all the low level file-handling routines (typical in application programs) Also provides 4th generation environment
Advantages of DBMSs
28
Improved maintenance through data independence DBMS separates data descriptions from the applications Increased concurrency DBMS manages concurrent database access Improved backup and recovery services Minimize the amount of processing that is lost following a failure
Disadvantages of DBMSs
29
Complexity
Size
Cost of DBMS
Disadvantages of DBMSs
30
Cost of conversion
Converting existing apps to run on new DBMS & hardware Staff training
Performance