Professional Documents
Culture Documents
Bab 1 - DB F 3038
Bab 1 - DB F 3038
Introduction
The fundamentals of building a good database system, the following steps are required :-
Raw data
Acquisition
Storage
Manipulation
Retrieval
Distribution
What is DBMS ?
y A database management system (DBMS) is a collection of
create, and maintain the database and that provides controlled access to this database.
1/5/2004
File-Based Systems
y Collection of application programs that perform
File-Based Processing
1/5/2004
programs
y Programs are written to satisfy particular functions. y Any new requirement needs a new program.
1/5/2004
Database System
y A database system is a system comprises of database, the
DBMS, and application programs, which are used by both developers and users.
TERMS
y User - A person, who adds, deletes and modifies data in the database. y Application - A business computer system that processes a portion of the database to meet user
information needs. It consists of menus, forms, reports, queries and application programs. y Application Programs - A custom developed program for processing a database. It can be written in a standard procedural language such as COBOL, C, or BASIC or in a language unique to the DBMS. Example: Book Information System.
y DBMS - A set of programs used to define, administer and process the database
Store Information
y A database stores list of information that are related to a
particular subject or purpose. y A database also makes it easy to add, update, organize and delete information. y Example:You can store business information, such as personal details of your customer, or list of customers who live in Selangor.
Find Information
y y
You can easily and instantly locate information stored in a database. Example:You can find all the customers with the last name John or all customer where their income is below RM 2000 and are older than 35.
Calculations on the information can be performed in a database to help you make quick and accurate decisions. Information is presented in professionally designed reports. Example:You can calculate the percentage of the sales that you make for every month.
information that constantly changes effectively. y Example: Staffs payrolls, customers, inventory.
-Many people use database to store personal information. -Information is easier to store and organise compared to using sheets of paper. -Example: Addresses and recipes
Data Sharing
Unlimited data sharingallows users from different departments to share the corporate data according to their information needs.
Limited data sharing difficult to share data when different applications create their own data files.
Data Dependence
The code and data descriptions (or file structures) are separated. The data descriptions can change without having to change the code that operates on the data.
To change the file structure, you also have to code, test and document your program all over again.
Data Security
As the database is centralized, it is relatively easy to protect the data against all kinds of threats whether accidental or intentional.
As the database is decentralized, it is not enough to have tight security in one department but no security in another department.
DATA MODEL
y A data model is a set of concepts that can be used to describe the
structure of a database. y It is the process of creating representation of the users` view of the data. If the data model incorrectly represents the users` view of the data, they will find the applications difficult to use, incomplete, and very frustrating. Below are types of data model:
NETWORK
SEMANTIC
record-based data models. y They include the three most widely used data models :y The relational model represents the database as a
collection of relations. Informally, each relation resembles a table or, to some extent, a simple file. y The hierarchical data model transforms all data relationships into hierarchies, or trees before they can be defined in the database. y The network data model represents data as record types and also represents a limited type of one-to-many relationships called a set type.
RELATIONAL MODEL
y The relational model
represents the database as a collection of relations. Informally, each relation resembles a table or, to some extent, a simple file.
and also represents a limited type of one-to-many relationships called a set type.
objects, their properties, and their operations. y The most commonly object based data models are entity relation, semantic, and functional data models.
like the E-R model. y For example, consider an object representing a bank account.
y The object contains instance variables number and balance. y The object contains a method pay-interest which adds interest to the
balance. y Under most data models, changing the interest rate entails changing code in application programs. y In the object-oriented model, this only entails a change within the pay-interest method.
consisting of a collection of basic objects (entities) and relationships among these objects.
y An entity is a distinguishable object that exists. y Each entity has associated with it a set of attributes describing it. y E.g. number and balance for an account entity. y A relationship is an association among several entities. y e.g. A cust_acct relationship associates a customer with each account he or she has. y The set of all entities or relationships of the same type is called the entity
set or relationship set. y Another essential element of the E-R diagram is the mapping cardinalities, which express the number of entities to which another entity can be associated via a relationship set.
queries
Physical based data model describes how data is stored in the computer by representing information 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 applications.
The description of database is called the database schema. A database schema is specified during database design and is not executed to change frequently. It defines a databases structure, its tables, relationships, domains, and business rules. A database schema is a design, the foundation on which the database and the application are built. The data in a database at a particular moment in time is called a database instance.
schema.
A database schema is specified during database design and is
time is called a database instance (or a set of occurrences). In a given database instance, each schema construct has each on current set of instances.
views.
y Users should not need to know physical database
storage details.
41
structures without affecting the users views. by changes to physical aspects of storage. of database without affecting all users.
42
43
44
computer. y Describes how the data is stored in the database. y The internal level has an internal schema, which describes the physical storage structure of the database. The internal schema uses a physical data model and describes the complete details of data storage and access paths for the database.
46
47
Key Facts
y Data are facts that can be recorded and that have implicit y y y
y y
meaning. A database is a collection of related data. A database management system (DBMS) is a collection of programs that enables users to create and maintain a database. A database system is a system comprises of database, the DBMS, and application programs, which are used by both developers and users. Database schema is the description of database A database instance is the data in a database at a particular moment
Database Language
Data definition language (DDL)
y Allows the DBA or user to describe and name entities, attributes,
descriptions of how the data should reside in the database, therefore language statements like CREATE TABLE or ALTER TABLE belong to DDL.
languages used by computer programs and/or database users to insert, delete and update data in a database. Typical manipulation include retrieval, insertion, deletion, and modification of the data. Read-only querying, i.e. SELECT, of this data may be considered to be either part of DML or outside it, depending on the context. Currently the most popular data manipulation language is that of SQL, which is used to retrieve and manipulate data in a Relational database.[1]
y y y y y
organized by the initial word in a statement, which is almost always a verb. In the case of SQL, these verbs are: SELECT ... INTO INSERT UPDATE DELETE The SELECT ... INTO form is considered to be DML because it manipulates (i.e. modifies) data
1. 2. 3. 4. 5.
Query Languages Forms Generators Report Generators Graphics Generators Application Generators.
53
54
55
56
Tools
CASE: Computer Aided Software Engineering Tools
DB designers/DBA/users Design phase
Information repository
Data dictionary (data repository) systems Catalog/design decisions/usage standards/application program
descriptions/user information
57
Communication Software
Provide access for remote users DB/DC package Supports for distributed DBMSs
58