CHAPTER TEN (10) CHAPTER TEN (10) INTRODUCTION TO DATABASE 05/13/22 1 STID 1103
CHAPTER TEN (10)CHAPTER TEN (10)
INTRODUCTION TO DATABASE
04/11/23 1STID 1103
Learning ObjectivesLearning 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.
04/11/23 2STID 1103
Chapter OutlineChapter Outline Introduction Creating the database Database Terms Hierarchy of Data Database approach Database Model Tutorial: Microsoft Access
04/11/23 3STID 1103
IntroductionIntroduction
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.
04/11/23 4STID 1103
DataData
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.
04/11/23 5STID 1103
InformationInformation
Information is data that is organizedand 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.
04/11/23 6STID 1103
Data and InformationData and Information
Computers process data into information.
04/11/23 7STID 1103
Step 1. The data, including a photograph, is entered and stored on the hard disk.
Step 2. The computer extracts the data from disk.
Step 3. The receipt is created and printed.
data stored on disk processing
receipt
DatabaseDatabase
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– Create database– Add, change, and delete data– Sort and retrieve data– Create forms and reports
04/11/23 8STID 1103
Creating the DatabaseCreating 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.
04/11/23 9STID 1103
Conceptual Data ModelConceptual 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
04/11/23 10STID 1103
Database TermsDatabase 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.04/11/23 11STID 1103
Database Terms (cont…)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.
04/11/23 12STID 1103
Binary RelationshipsBinary 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.
04/11/23 13STID 1103
Entity- relationship diagram Entity- relationship diagram modelmodel
04/11/23 14STID 1103
Database Terms (cont…)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
04/11/23 15STID 1103
Normalized relationNormalized relation
04/11/23 16STID 1103
Non-normalized relationNon-normalized relation
04/11/23 17STID 1103
Database Terms (cont…)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 user’s view of the data and the software programs that process that data in a database management system.
04/11/23 18STID 1103
The Hierarchy of DataThe 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.
04/11/23 19STID 1103
The Hierarchy of DataThe Hierarchy of Data
04/11/23 20STID 1103
Database contains files, file contains records, record contains fields, field contains characters, characters are represented by bytes and bits.
FieldField
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
04/11/23 21STID 1103
Data TypeData 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 text entries
04/11/23 22STID 1103
Data Type (cont…)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 ~
04/11/23 23STID 1103
RecordRecord
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.
04/11/23 24STID 1103
FileFile
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.
04/11/23 25STID 1103
Data FileData File
Collection of related records stored on disk
04/11/23 26STID 1103
key field
records fields
22 Fifth Avenue
P.O. Box 45
15 Duluth Street
33099 Clark Street
1029 Wolf Avenue
Address
Auburn
Clanton
Prattville
Montgomery
Montgomery
City
ALWeinbergJonah3928
ALMarcus4872
ALValesquezAdrian3376
ALMurrayShannon2928
ALVandenbergDonna2295
StateLast NameFirst NameMember ID
Green
File Processing SystemFile 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 redundancy—same fields stored in multiple
files– Isolated data—data stored in separate files so it is
difficult to access
04/11/23 27STID 1103
Database ApproachDatabase Approach
Many programs and users can share data in database.
Secures data so only authorized users can access certain data
04/11/23 28STID 1103
Database Approach (cont…)Database Approach (cont…)
Strengths of the database approach– Reduced data redundancy– Improved data integrity/consistency– Shared data– Easier access– Reduced development time
04/11/23 29STID 1103
File Processing Versus DatabasesFile Processing Versus Databases
How do a database application and a file processing application differ in the way they store data?
04/11/23 30STID 1103
Example of Database Example of Database Management System (DBMS)Management System (DBMS)
04/11/23 31STID 1103
Personal computer, midrange server, mainframe
IBM CorporationDB2
Personal computer, midrange server, mainframe
IBM CorporationInformix
ServerMicrosoft CorporationSQL Server
Personal computer, midrange server, PDA
Sybase Inc.Sybase
Personal computer, midrange server, mainframe, PDA
Oracle CorporationOracle
Personal computer, midrange server, mainframe
Computer Associates International, Inc.
Ingres
Personal computer, server, PDAMicrosoft CorporationAccess
Computer TypeManufacturerDatabase
DBMS TermsDBMS Terms
Data dictionary Structured Query Language (SQL) Query Query by Example (QBE) Form Report generator Data model
04/11/23 32STID 1103
Data DictionaryData Dictionary Known as metadata
repository, a "centralized repository of information about data such as meaning, relationships to other data, origin, usage, and format.
04/11/23 33STID 1103
Contains data about each file in database and each field within those files.
Structured Query Language Structured Query Language (SQL)(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
04/11/23 34STID 1103
SQL statementSQL statement results
QueryQuery
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.
04/11/23 35STID 1103
Step 1. Select the fields you want to display in the resulting query.
Step 2. Assign a name to the query, so you can open it later.
Step 3. View query on the screen.
Query by Example (QBE)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
04/11/23
Query by example screen
criteria
Query results
FormForm 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 e-form, short for electronic form.
Report GeneratorReport Generator
Also called report writer. Allows user to design a report on screen, retrieve
data into report design, then display or print reports.
04/11/23 38STID 1103
Data ModelData 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, object-relational, hypermedia, embedded, and virtual.
04/11/23 39STID 1103
Relational Database ModelRelational 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:
04/11/23 40STID 1103
RelationshipRelationship
Connection within data; link tables sharing the common field.
04/11/23 41STID 1103
Hierarchical Database ModelHierarchical 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.
04/11/23 42STID 1103
Hierarchical Database ModelHierarchical Database Model
04/11/23 43STID 1103
Network Database ModelNetwork Database Model
Data model that creates relationships among data in which subordinate records can be linked to more than one data element.
04/11/23 44STID 1103
Example of Database ModelExample of Database Model
04/11/23 45STID 1103
Advantages and Disadvantages Advantages and Disadvantages of Logical Data Modelsof Logical Data Models
04/11/23 46STID 1103
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.
Network Many more relationships can be defined. There is greater speed and efficiency than with relational database models.
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.
Relational database Conceptual simplicity; there are no predefined relationships among data. High flexibility in ad-hoc querying. New data and records can be added easily.
Processing efficiency and speed are lower. Data redundancy is common, requiring additional maintenance.
Emerging Database ModelEmerging Database Model Two emerging data models are the object-
relational 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.
04/11/23 47STID 1103
Specialized Database ModelSpecialized 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.
04/11/23 48STID 1103
Specialized Database Model Specialized Database Model (cont…)(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.
04/11/23 49STID 1103
Object-Oriented Database Object-Oriented Database (OODB)(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.– Can access data faster
04/11/23 50STID 1103
Examples of applications for an Examples of applications for an object-oriented database?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
04/11/23 51STID 1103
Examples of applications for an Examples of applications for an object-oriented database?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
04/11/23 52STID 1103
TUTORIALTUTORIAL
MICROSOFT ACCESS 2007
http://www.gcflearnfree.org/computer/topic.aspx?id=146
04/11/23 53STID 1103