DB_CH1HUDA

advertisement
Database Design
Chapter-1- Basic Concepts
Reference:
Prof. Mona Mursi Lecture notes
Fatimah Alakeel
1
Database Concepts
Data is a meaningless static value. What does 3421 means?
Information is the data you process in a manner that makes it
meaningful. Information can be provided only if proper data exists.
A database (DB) is a collection of related data. Can be generated &
maintained manually or automatically
Data is what you store in database.
Information is what you retrieve from a database.
A database application is a collection of data and the programs that
allow the manipulation of these data to meet the information needs of
an enterprise
Fatimah Alakeel
2
Database Application:
Examples

KSU Library

Saudia Airline Reservations

Car rental DB

A DB for all schools in Riyadh
Fatimah Alakeel
3
Database Properties




Represents the real world (miniworld)
Can be of any size and any degree of complexity.
Can be generated and maintained manually or using a computer.
A computerized DB can be created by:
 A Group of application programs
 Or by Database Management System (DBMS)
Fatimah Alakeel
4
The Data in the DB are




Shared by multiple Application (users and
programs )
Stored less redundantly
Made independent of applications
Organized to provide a foundation for future
application.
Fatimah Alakeel
5
Database Management System
(DBMS)


A collection of programs that enables the users to create and
maintain a database.
A general- purpose software system that facilitates the process of :
 Defining (specifying data types, structures and constraints)
 Constructing (storing the data on a storage medium controlled
by DBMS)
 Manipulating (querying, update, generate reports)
Fatimah Alakeel
6
DBS Environment
DBS
Application Programs
DBMS
Query Process
Data Access
Meta-Data
Database
Fatimah
Database System
=Alakeel
Database + DBMS
7
DBMS Capabilities &
Responsibilities
1.
2.
3.
4.
5.
6.
7.
8.
Control redundancy.
Access a large amount of data efficiently.
Support HLL to define, access and manipulate data.
Provide correct access to data by multiple users.
Provide multiple users views.
Maintain data integrity.
Protect data from unauthorized access .
Recover from failures.
Fatimah Alakeel
8
Database Management System
Major Relational DBMS vendors/products






Paradox by Corel
dBase, Clipper
FoxPro, Access & SQL Server by MS
MySQL
DB2 by IBM
Oracle, Sybase, Informix
Fatimah Alakeel
9
Advantages of Database Systems
over Paper-Based Systems
1.
2.
3.
4.
Compactness
Speed
Less of hard work
Accurate .
Fatimah Alakeel
10
File-Based Systems (FBS)
FBS is a collection of application programs that perform tasks
where each program defines and manages its own data.
User 1
Data
Entry
File
handling
File Def
Application Program 1
User 2
Data
Entry
File1
File
handling
File Def
Application Program 2
Fatimah Alakeel
File 2
11
Database Systems (DBS)
DBS is a single large repository of data, defined once & used by
many application programs.
User 1
Data
Entry
Application Program 1
DBMS
User 2
Database
Data
Entry
Application Program 2
Fatimah Alakeel
12
Characteristics of DB
Approach
Self –Describing nature of a database system

The database system contains:


Database
Complete definition of the DB structure and constraints
(catalog)
DBMS
Catalog
Meta- Data
Database
The DBMS works with any number of database applications
13
Fatimah Alakeel
Characteristics of DB
Approach
Program-Data Independence
 In file based systems the structure of data files is
embedded in the access programs => any change
to the structure may require changing all accessing
programs
 In DBMS any change in the structure does not
require changing the access programs because the
structure is stored in the DBMS catalog. => this is
called program-data independence.
Fatimah Alakeel
14
Characteristics of DB
Approach
Data Abstraction


DBMS provides a conceptual representation
of the data => no much details about how the
data is stored and how the operations are
implemented.
There are different levels of abstraction.
Fatimah Alakeel
15
Characteristics of DB
Approach
Describe some parts of
the databse
Users
Data Abstraction
View 1
What data is stored
and how its
interrelated (tables
or tree)
Database
Administrators
View 2
View 3
……..
View N
Conceptual Level
How the data is
stored in the
physical media
Implementers
Physical Level
Fatimah Alakeel
16
Characteristics of DB Approach
DBS Support of Multiple Views of Data
Virtual data
derived from
the data base
View 1
Staff_No
FName
LName
Staff_No
FName
Age
Salary
LName
Fatimah Alakeel
DOB
View 2
Staff_No LName
Salary
Bno
Bno
17
Characteristics of DB
Approach
Sharing of data and multiuser transaction
processing
 DBMS includes concurrency control software =>
to ensure that several users trying to update the
same data can do that in a controlled manner so the
result of the update is correct.
Fatimah Alakeel
18
Data Models
Data
Model is a set of concepts for describing the
structure of a DB (data, relationships, constraints)
Used for the conceptual and view levels
Categories of data models:
- Object-based logical model
- Record-based logical model
- Physical model
Fatimah Alakeel
19
Categories of Data Models
Object-based logical model

Examples:



Entity Relationship Model (ER)
Object Oriented Models (OO)
Characteristics:



Data is viewed as sets Entities represent things in the real world
Entities are distinct
New kind of entities can be constructed from old kinds
Fatimah Alakeel
20
Categories of Data Models
Record-based logical model
 Data viewed as a fixed- format records of
various types.
 Examples:



Relational model
Network model
Hierarchical model
Fatimah Alakeel
21
Example Field
STUDENT Name StudentNumber Class
Smith
17
1
Brown
8
2
COURSE
Major
CS
CS
Record
CourseName
CourseNumber CreditHours Department
Discrete Mathematics MATH2410
3
MATH
Database
CS3380
4
CS
SECTION SectionIDentifier CourseNumber Semester Year
85
MATH2410
Fall
03
135
CS3380
Fall
04
Instructor
Anderson
Stone
GRADE_REPORT StudentNumber SectionIDentifier Grade
17
85
A
17
135
B
8
135
A
PREREQUISITE CourseNumber PrerequisiteNumber
MATH222
MATH211
CS3380
CS210
Fatimah Alakeel
22
Download