You are on page 1of 53

CHAPTER TEN (10)

INTRODUCTION TO DATABASE

3/24/2012

STID 1103

Learning Objectives
After completing this chapter you will be able to: Introduce the basic concepts of database. Explain database system model. Describe Evolution of database. Explain basic operation in build database systems. Describe the use of table, relationship, query, form and report.

3/24/2012

STID 1103

Chapter Outline

Introduction Creating the database Database Terms Hierarchy of Data Database approach Database Model Tutorial: Microsoft Access

3/24/2012

STID 1103

Introduction
A database consists of an organized collection of data for one or more uses, typically in digital form. Digital databases are managed using database management systems, which store database contents, allowing data creation and maintenance, and search and other access.

3/24/2012 STID 1103 4

Data
Data are raw facts. Raw data refers to a collection of numbers, characters, images or other outputs from devices that collect information to convert physical quantities into symbols, that are unprocessed.

3/24/2012 STID 1103 5

Information
Information is data that is organized and meaningful. Data is typically further processed by a human or input into a computer, stored and processed there, or transmitted (output) to another human or computer in the form on information.

3/24/2012 STID 1103 6

Data and Information

Computers process data into information.

Step 1. The data, including a photograph,

is entered and stored on the hard disk.

Step 3. The receipt is

created and printed.

Step 2. The

computer extracts the data from disk.


receipt

data stored on disk

processing

3/24/2012

STID 1103

Database

Collection of data organized so you can access, retrieve, and use it. Database software also called database management system (DBMS). Database software allows you to

3/24/2012

Create database Add, change, and delete data Sort and retrieve data Create forms and reports
STID 1103 8

Creating the Database

To create a database, designers must develop a conceptual design and a physical design. Conceptual design: An abstract model of a database from the user or business perspective. Physical design: Layout that shows how a database is actually arranged on storage devices.
3/24/2012 STID 1103 9

Conceptual Data Model

A map of concepts and their relationships. It describes the things of significance to an organization (entity classes), about which it is inclined/influence to collect information, and characteristics of (attributes) and associations between pairs of those things of significance (relationships). Example: Entity-relationship modeling
3/24/2012 STID 1103 10

Database Terms

Entity-relationship modeling: The process of designing a database by organizing data entities to be used and identifying the relationships among them. Entity-relationship (ER) diagram: Document that shows data entities and attributes and relationships among them. Entity classes: A grouping of entities of a given type. Instance: A particular entity within an entity class.
STID 1103 11

3/24/2012

Database Terms (cont)

Identifier: An attribute that identifies an entity instance. Relationships: The conceptual linking of entities in a database. The number of entities in a relationship is the degree of the relationship. Relationships between two items are common and are called binary relationships.
3/24/2012 STID 1103 12

Binary Relationships

There are three types of binary relationships:


1:1 (one-to-one) relationship: a single-entity instance of one type is related to a single-entity instance of another type. 1: M (one-to-many) relationship: a single-entity instance of one type is related to many-entity instance of another type. M:M (many-to-many) relationship: a single-entity instance of one type is related to many-entity of another type and vice versa.

3/24/2012

STID 1103

13

Entity- relationship diagram model

3/24/2012

STID 1103

14

Database Terms (cont)

Normalization ~ A method for analyzing and reducing a relational database to its most streamlined form for minimum redundancy, maximum data integrity, and best processing performance

3/24/2012

STID 1103

15

Normalized relation

3/24/2012

STID 1103

16

Non-normalized relation

3/24/2012

STID 1103

17

Database Terms (cont)

Physical view: The plan for the actual, physical arrangement and location of data in the direct access storage devices (DASDs) of a database management system. Logical view: The users view of the data and the software programs that process that data in a database management system.

3/24/2012

STID 1103

18

The Hierarchy of Data

Refers to the systematic organization of data, often in a hierarchical form. A hierarchy is an arrangement of items (objects, names, values, categories, etc.) in which the items are represented as being "above," "below," or "at the same level as" one another. (the items are represented as being "above," "below," or "at the same level as" one another) Database contains files, file contains records, record contains fields, field contains characters.
3/24/2012 STID 1103 19

The Hierarchy of Data

Database contains files, file contains records, record contains fields, field contains characters, characters are represented by bytes and bits.

3/24/2012

STID 1103

20

Field

A data field holds a single fact. Combination of one or more characters. Example: October 18, 2010". This can be treated as a single date field (eg birthdate), or 3 fields, namely, month, day of month and year. Smallest unit of data user accesses
Field size defines the maximum number of characters a field can contain Field name uniquely identifies each field Data type specifies kind of data field contains

3/24/2012

STID 1103

21

Data Type

A classification identifying one of various types of data

Text (also called alphanumeric) letters, numbers, or special characters Numeric - numbers only AutoNumber - unique number automatically assigned to each new record Currency - dollar and cent amounts or numbers containing decimal values Date - month, day, year, and sometimes time Memo - lengthy textSTID 1103 entries 3/24/2012 22

Data Type (cont)


Yes/No (also called Boolean) only the values Yes or No (or True or False) Hyperlink - Web address that links to document or Web page Object - OLE Object (Object Linking and Embedding) or BLOB (Binary Large Object) photograph, audio, video, or document created in other application such as word processing or spreadsheet (OLE object ~

3/24/2012 STID 1103 23

Record

A record (tuple) is a collection of related fields or a group of related fields. An Employee record may contain a name field(s), address fields, birthdate field and so on. Key field, or primary key is a field or combination of fields that uniquely identifies each record in the table.
3/24/2012 STID 1103 24

File

A file is a collection of related records. If there are 100 employees, then each employee would have a record (e.g. called Employee Personal Details record) and the collection of 100 such records would constitute a file (in this case, called Employee Personal Details file). Files are integrated into a database. This is done using a Database Management System.
3/24/2012 STID 1103 25

Data File

Collection of related records stored on disk


Member ID First Name Last Name Address City State

2295
2928 3376 3928 4872

Donna
Shannon Adrian Jonah Marcus

Vandenberg
Murray Valesquez Weinberg Green

1029 Wolf Avenue


33099 Clark Street 15 Duluth Street P.O. Box 45 22 Fifth Avenue

Montgomery
Montgomery Prattville Clanton Auburn

AL
AL AL AL AL

records

key field

fields

3/24/2012

STID 1103

26

File Processing System

Each department or area within organization has own set of files. Records in one file may not relate to records in any other file. May have weaknesses
Data redundancysame fields stored in multiple files Isolated datadata stored in separate files so it is difficult to access
3/24/2012 STID 1103 27

Database Approach

Many programs and users can share data in database. Secures data so only authorized users can access certain data

3/24/2012

STID 1103

28

Database Approach (cont)

Strengths of the database approach


Reduced data redundancy Improved data integrity/consistency Shared data Easier access Reduced development time

3/24/2012

STID 1103

29

File Processing Versus Databases

How do a database application and a file processing application differ in the way they store data?
STID 1103 30

3/24/2012

Example of Database Management System (DBMS)


Database Access DB2 Informix Ingres Oracle SQL Server Sybase
3/24/2012

Manufacturer Microsoft Corporation IBM Corporation IBM Corporation Computer Associates International, Inc. Oracle Corporation Microsoft Corporation Sybase Inc.

Computer Type Personal computer, server, PDA Personal computer, midrange server, mainframe Personal computer, midrange server, mainframe Personal computer, midrange server, mainframe Personal computer, midrange server, mainframe, PDA Server Personal computer, midrange server, PDA
STID 1103 31

DBMS Terms

Data dictionary Structured Query Language (SQL) Query Query by Example (QBE) Form Report generator Data model

3/24/2012

STID 1103

32

Data Dictionary

Known as metadata Contains data about each file in repository, a database and each field within "centralized those files. repository of information about data such as meaning, relationships to other data, origin, usage, and format.

3/24/2012

STID 1103

33

Structured Query Language (SQL)

A database computer language designed for managing data in relational database management systems (RDBMS). Allows you to manage, update, and retrieve data Has special keywords and rules included in SQL statements
SQL statement results

SQL statement

3/24/2012

STID 1103

34

Query

Step 1. Select the fields you want

to display in the resulting query.

Request for specific data from a database. Query language consists of simple, English-like statements that allow users to specify data to display, print, or store.
Step 3. View query on the screen.

Step 2. Assign a name to the

query, so you can open it later.

3/24/2012

STID 1103

35

Query by Example (QBE)


A database query language for relational databases Program retrieves records that match criteria entered in form fields Has a graphical user interface that assists users with retrieving data
Query by example screen

criteria Query results

3/24/2012

Form

Window on screen that provides areas for entering or changing data in database. Used to retrieve and maintain data in a database. Form that sends data across network or Internet is called eform, short for electronic form.

Report Generator

Also called report writer. Allows user to design a report on screen, retrieve data into report design, then display or print reports.

3/24/2012

STID 1103

38

Data Model

Rules and standards that define how database organizes data and how users view organization of data. The three most common data models are hierarchical, network, and relational. Other types of data models include multidimensional, objectrelational, hypermedia, embedded, and virtual.
3/24/2012 STID 1103 39

Relational Database Model

Stores data in tables that consist of rows and columns


Each row has primary key Each column has unique name

Stores data relationships. Uses specialized terminology:

3/24/2012

STID 1103

40

Relationship

Connection within data; link tables sharing the common field.

3/24/2012

STID 1103

41

Hierarchical Database Model

Structures data into an inverted tree in which each record contains two elements, a single root or master field, often called a key, and a variable number of subordinate fields. Advantage is the speed and efficiency with which it can be searched for data. problems:
Access to data in this model is predefined by the database administrator before the programs that access the data are written. Programmers must follow the hierarchy established by the data structure.
3/24/2012 STID 1103 42

Hierarchical Database Model

3/24/2012

STID 1103

43

Network Database Model

Data model that creates relationships among data in which subordinate records can be linked to more than one data element.

3/24/2012

STID 1103

44

Example of Database Model

3/24/2012

STID 1103

45

Advantages and Disadvantages of Logical Data Models


Model Advantages Disadvantages

Hierarchical database

Searching is fast and efficient.

Access to data is predefined by exclusively hierarchical relationships, predetermined by administrator. Limited search/query flexibility. Not all data are naturally hierarchical. This is the most complicated database model to design, Implement, and maintain. Greater query flexibility than with hierarchical model, but less than with relational model. Processing efficiency and speed are lower. Data redundancy is common, requiring additional maintenance.

Network

Many more relationships can be defined. There is greater speed and efficiency than with relational database models. Conceptual simplicity; there are no predefined relationships among data. High flexibility in ad-hoc querying. New data and records can be added easily.

Relational database

3/24/2012

STID 1103

46

Emerging Database Model

Two emerging data models are the objectrelational and hypermedia models
Object-relational database model: Data model that adds new object storage capabilities to relational databases. Hypermedia database model: Data model that stores chunks of information in nodes that can contain data in a variety of media; users can branch to related data in any kind of relationship.

3/24/2012

STID 1103

47

Specialized Database Model

Geographical information database: Data model that contains locational data for overlaying on maps or images. Knowledge database: Data model that can store decision rules that can be used for expert decision making. Small-footprint database: The subset of a larger database provided for field workers.

3/24/2012

STID 1103

48

Specialized Database Model (cont)

Embedded database: A database built into devices or into applications; designed to be self-sufficient and to require little or no administration. Virtual database: A database that consists only of software; manages data that can physically reside anywhere on the network and in a variety of formats.

3/24/2012

STID 1103

49

Object-Oriented Database (OODB)


a database model in which information is represented in the form of objects. Object is item that contains data, as well as actions that read or process data. Often uses object query language (OQL). Advantages:

Can store more types of data. 3/24/2012 STID 1103 Can access data faster

50

Examples of applications for an object-oriented database?

Multimedia databases
Store images, audio clips, and/or video clips

Hypertext databases
Contain text links to other documents

Hypermedia databases
Contain text, graphics, video, and sound

3/24/2012

STID 1103

51

Examples of applications for an object-oriented database?

Computer-aided design (CAD) databases


Store data about engineering, architectural, and scientific designs Groupware databases Store documents such as schedules, calendars, manuals, memos, and reports

Web databases
Link to e-form on Web page

3/24/2012

STID 1103

52

TUTORIAL
MICROSOFT ACCESS 2007 http://www.gcflearnfree.org/computer/topic.aspx? id=146
3/24/2012 STID 1103 53

You might also like