Chapter 1
description
Transcript of Chapter 1
![Page 1: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/1.jpg)
Lilac Safadi Database Systems 1
Chapter 1
Database ConceptsDatabase Concepts
Chapter 1 &2 in Textbook
![Page 2: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/2.jpg)
Lilac Safadi Database Systems 2
Database ConceptsDatabase ConceptsData 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 persistent 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
![Page 3: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/3.jpg)
Lilac Safadi Database Systems 3
Database Application: ExamplesDatabase Application: Examples
• The e-shop around the corner
• KSU Library
• Saudia Airline Reservations
• KSU University
![Page 4: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/4.jpg)
Lilac Safadi Database Systems 4
Database ConceptsDatabase Concepts
A database application is usually implemented using a Database Management System (DBMS)
Database System (DBS) is DB + Software (DBMS + Application program) (TO BE CONTINUED ..)
![Page 5: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/5.jpg)
Lilac Safadi Database Systems 5
DBS EnvironmentDBS Environment
DatabaseMeta-Data
Data Access
Query Process
Application Programs
DBMS
DBS
![Page 6: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/6.jpg)
Lilac Safadi Database Systems 6
File-Based Systems (FBS)File-Based Systems (FBS)
FBS is a collection of application programs that perform tasks where each program defines and manages its own data.
DataEntry
Filehandling
File DefUser 1
Application Program 1 File1
DataEntry
Filehandling
File DefUser 2
Application Program 2 File 2
![Page 7: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/7.jpg)
Lilac Safadi Database Systems 7
File-Based Systems (FBS)File-Based Systems (FBS)Major Disadvantages of FBS:
• Data Redundancy & Inconsistency• Data Isolation• Data Dependence• Incompatible File Format• Fixed Queries/Proliferation of application
programs
![Page 8: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/8.jpg)
Lilac Safadi Database Systems 8
File-Based Systems (FBS)File-Based Systems (FBS)
The limitations of the FBS approach attributed to two factors:
• The definition of data is embedded in the application programs
• There is no control over the access & manipulation of data beyond the imposed by the application program
![Page 9: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/9.jpg)
Lilac Safadi Database Systems 9
DataBased Systems (DBS)DataBased Systems (DBS)
DBS is a single large repository of data, defined once & used by many application programs.
User 1
Application Program 1
DatabaseUser 2
Application Program 2
DataEntry
DataEntry
DBMS
![Page 10: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/10.jpg)
Lilac Safadi Database Systems 10
Database Systems (DBS) Database Systems (DBS) Ref 1Ref 1
Major Characteristics of DBS:
• Self-Describing nature • Program-Data Independence• Sharing of Data & Multi-user Transactions
(Concurrency Control)• Support of Multiple Views of the Data
![Page 11: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/11.jpg)
Lilac Safadi Database Systems 11
Database Systems (DBS)Database Systems (DBS)
Staff_No FName LName Age Salary Bno
Staff_No FName LName Age Salary Staff_No LName Bno
View 1 View 2
DBS Support of Multiple Views of Data
![Page 12: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/12.jpg)
Lilac Safadi Database Systems 12
Database Systems (DBS)Database Systems (DBS)
Disadvantages of DBS:
• Complexity• Size• Cost (DBMS,Hardware, Staff, Training)• Performance• Higher impact of a failure
![Page 13: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/13.jpg)
Lilac Safadi Database Systems 13
Database Management SystemDatabase Management System(DBMS)(DBMS)
A DBMS is a collection of software that facilitates the implementation and management of database applications
![Page 14: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/14.jpg)
Lilac Safadi Database Systems 14
Database Management System Database Management System (DBMS)(DBMS)
DBMS facilitates the following:
• Creating and Defining a DB• Construct and Store a DB• Manipulate a DB (query & update the DB)• Control access to data
![Page 15: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/15.jpg)
Lilac Safadi Database Systems 15
Database Management SystemDatabase 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
![Page 16: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/16.jpg)
Lilac Safadi Database Systems 16
DBS EnvironmentDBS Environment
DBMSApp
Program
DB
UserRequirement
Procedure
DBA
Naïve End User
Applicationprogrammer
DB Designer System Analyst
Sophisticated End User H/W
Design
Communicate
Manage
Write Write
Program
Use
Use
![Page 17: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/17.jpg)
Lilac Safadi Database Systems 17
Database PeopleDatabase People• Database Administrator (DBA): administrates the DB, DBMS & related
software
• Database Designer: Identify the data & choose the appropriate structure to represent &store the data
• Database user: Queries/modifies data- Naïve users: invoke one of the permanent application programs that have been written previously
- Sophisticated users: form requests in a database query language
![Page 18: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/18.jpg)
Lilac Safadi Database Systems 18
Database PeopleDatabase People
• System Analyst: determine the requirements of end users & develop system specifications
• Application Programmer: implement system specifications
• DBMS designer & Implementers
• Tool Developer
• Operators & Maintenance Personnel
![Page 19: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/19.jpg)
Lilac Safadi Database Systems 19
Three-Schema Architecture
![Page 20: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/20.jpg)
Lilac Safadi Database Systems 20
Three-Schema Architecture
Database
InternalDescription
ConceptualDescription
View 2 View nView 1
User 1 User 2 User n
ExternalLevel
ConceptualLevel
InternalLevel
![Page 21: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/21.jpg)
Lilac Safadi Database Systems 21
Three-Schema Architecture
•Internal level: describes how data is stored. The way perceived by the DBMS & OS.
•Conceptual level: describes what data stored in DB, and the relationships among the data. The way perceived by the DBA & programmers.
•External level: describes the part of the DB that user is interested in. The way perceived by the end users.
![Page 22: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/22.jpg)
Lilac Safadi Database Systems 22
Three-Schema Architecture
Emp_No FName LName Dept_No Emp_No LName Salary
View 1 View 2
InternalLevel
ConceptualLevel
EMPLOYEEEmp_No CHAR(6)FName CHAR(15)LName CHAR(15)Dept_No CHAR(3)Salary NUMBER(5)
PREFIX TYPE=BYTE(6),OFFSET=0EMP# TYPE=BYTE(6),OFFSET=6, INDEX=EMPXLNM TYPE=BYTE(15),OFFSET=12FNM TYPE=BYTE(15),OFFSET=27DPT# TYPE=BYTE(4),OFFSET=42PAY TYPE=FULLWORD,OFFSET=46
ExternalLevel
![Page 23: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/23.jpg)
Lilac Safadi Database Systems 23
Schemas & Instances
Schema is the description of the DB.It rarely changes.
Instance is the actual content of the DB at a particular point in time. Data is actual "instance" of DB, changes rapidly.
The concepts of Schema & Instances corresponds to Types & Values in programming languages, respectively
![Page 24: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/24.jpg)
Lilac Safadi Database Systems 24
Mapping
Mapping is the process of transforming requests and results between the Internal, Conceptual & External levels.
Two types of mapping:
- External / Conceptual mapping
-Conceptual / Internal mapping
![Page 25: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/25.jpg)
Lilac Safadi Database Systems 25
Data Independence
Data Independence is the ability to modify a schema definition in one level without affecting a schema definition in the next higher level.
Two levels of data independence:
– Logical data independence
– Physical data independence
![Page 26: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/26.jpg)
Lilac Safadi Database Systems 26
Data Independence
InternalSchema
ConceptualSchema
ExternalSchema
ExternalSchema
ExternalSchema
External/ConceptualMapping
Conceptual/InternalMapping
Logical data Independence
Physical data Independence
![Page 27: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/27.jpg)
Lilac Safadi Database Systems 27
Data Definition Language (DDL)
DDL is a descriptive language for defining the database schema
DDL compiler generates meta-data stored in a the data dictionary
![Page 28: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/28.jpg)
Lilac Safadi Database Systems 28
Data Manipulation Language (DML)
Two classes of languages
– Procedural: user specifies what data is required and how to get those data
– Nonprocedural: user specifies what data is required without specifying how to get those data (e.g. SQL)
DML is a language for retrieving and updating (insert, delete, & modify) the data in the DB
![Page 29: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/29.jpg)
Lilac Safadi Database Systems 29
Database Languages
DBMS have a facility for embedding DDL & DML (sub-languages) in a High-Level Language (COBOL,PASCAL, C), which in this case is considered a host language.
DBMSCall to DB
C,C++,Lisp,..
Local Vars(memory)
ApplicationProgram
![Page 30: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/30.jpg)
Lilac Safadi Database Systems 30
Data Models
Data Model is a set of concepts for describing the structure of a DB
Categories of data models:
- Object-based conceptual model
- Record-based logical model
- Physical model
![Page 31: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/31.jpg)
Lilac Safadi Database Systems 31
Data Models
Conceptual model is the construction of an enterprise’s information that is independent of implementation details.
Logical model is the logical description of an enterprise’s information with high level description of the implementation.
![Page 32: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/32.jpg)
Lilac Safadi Database Systems 32
Data Models
Physical model
Logicalmodel
Conceptualmodel
Hardware dependentSoftware dependent
Hardware independentSoftware dependent
Hardware independentSoftware independent
![Page 33: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/33.jpg)
Lilac Safadi Database Systems 33
Data ModelsObject-based conceptual model
– Entity-Relationship
– Object-Oriented
– Semantic
– Functional
- Binary
Record-based logical models
– Relational model
– Network model
– Hierarchical model
![Page 34: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/34.jpg)
Lilac Safadi Database Systems 34
Data Models
Staff_No LName Salary Brn_No Brn_No Street Tel_No
St1 Name1 7000 1St2 Name2 4000 1St3 Name3 6500 2St4 Name4 3000 3
1 Olayaa 46300002 Malaz 47800003 Rawda 2310000
St1 Name1 7000 Olayaa 4630000
St2 Name2 4000
St3 Name3 6500
St4 Name4 3000
Malaz 4780000
Rawda 2310000
RelationalModel
NetworkModel
![Page 35: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/35.jpg)
Lilac Safadi Database Systems 35
Data Models
St3 Name3 6500
HierarchicalModel
St1 Name1 7000 St2 Name2 4000
St4 Name4 3000
Olayaa 4630000Malaz 4780000 Rawda 2310000
![Page 36: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/36.jpg)
Lilac Safadi Database Systems 36
Summary of DB Concepts (1)
• Database (DB)
• Database Application
• Database Management System (DBMS)
• Database System (DBS) - Centralized approach
• File-Based System(FBS) - Decentralized approach
• Program-data dependence & independence
• Meta-data & data dictionary
• Concurrency Control
![Page 37: Chapter 1](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814e2d550346895dbb90f3/html5/thumbnails/37.jpg)
Lilac Safadi Database Systems 37
Summary of DB Concepts (2)• Three-schema Architecture (internal, conceptual, & external levels)
• Schemas &Instances
• Mapping (external/conceptual, conceptual/internal)
• Data Independence (logical & physical)
• Data Definition Language (DDL)
• Data Manipulation Language (DML)
• Query language& host language
• Conceptual model,Logical model,&Physical model
• Data model (Entity-Relationship, Object-Oriented, Relational)