بسم الله الرحمن الرحيم 1. lecture (1) 2 welcome welcome to حسب304 an...

83
م ي ح ر ل ا ن م ح ر ل ه ا ل ل م ا س ب م ي ح ر ل ا ن م ح ر ل ه ا ل ل م ا س ب1 1

Upload: emery-copeland

Post on 14-Jan-2016

227 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

الرحيم الرحمن الله الرحيم بسم الرحمن الله بسم

11

Page 2: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Lecture (1)Lecture (1)

22

Page 3: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

WelcomeWelcome

Welcome to Welcome to 304304حسبحسب

An Introduction to databases.An Introduction to databases.

We hope you will enjoy it.We hope you will enjoy it.

33

Page 4: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Information about courseInformation about course

المقرر البيانات: إسم قواعد AnمبادئIntroduction to databases

المقرر 304حسب :رمز

44

Page 5: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database course - PeopleDatabase course - People

. . الحسن: محمد ايمان أ المحاضر Office hours: sunday 10-2 .

Email :[email protected].

: التدريس مساعدى

55

Page 6: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

الدراسة الدراسة مدة ::مدة

عشر اربعة لمدة أسبوعيا واحدة عشر محاضرة اربعة لمدة أسبوعيا واحدة محاضرةساعتان . المحاضرة مدة ، ساعتان .أسبوعا المحاضرة مدة ، أسبوعا

المقرر :تقييمالنهائي 60% االمتحاننصف 15% االمتحان

الفصلي 25%+ مشروع تمارين

66

Page 7: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

المقرر المقرر متطلبات متطلبات

برامج وإحدي البرمجة لغات بإحدي برامج اإللمام وإحدي البرمجة لغات بإحدي اإللمام. البيانات قواعد نظم .إدارة البيانات قواعد نظم إدارة

77

Page 8: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

المقرر المقرر أهداف أهداف

الي االتجاه ولماذا البيانات قواعد على الي التعرف االتجاه ولماذا البيانات قواعد على التعرفالنظم عن 8 بدال البيانات قواعد نظم النظم استخدام عن 8 بدال البيانات قواعد نظم استخدام

بيانات قاعدة تصميم كيفية ثم القديمة بيانات التقليدية قاعدة تصميم كيفية ثم القديمة التقليديةعلي التعرف و صحيحة علمية وبأسس علي جديدة التعرف و صحيحة علمية وبأسس جديدة

. البيانات قواعد نظم برامج .لغات البيانات قواعد نظم برامج لغات

88

Page 9: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

المستخدمة المستخدمة المراجع المراجع

: االساسي :المرجع االساسي المرجعElmasri and Shamkant. "Fundamentals of Elmasri and Shamkant. "Fundamentals of

Database SystemsDatabase Systems."." 5th edition5th edition..

: إضافي :مرجع إضافي مرجعThomas M. Connolly &Carolyn Thomas M. Connolly &Carolyn E.Begg"DataBase Systems,A practical E.Begg"DataBase Systems,A practical Approach To Approach To Design ,Implementation ,And Design ,Implementation ,And Management . Management .

Second Edition Second Edition.. Two references are published by Addison Two references are published by Addison Wesley .Wesley .

99

Page 10: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database Systems in two wordsDatabase Systems in two words

This course is an introduction to database systemsThis course is an introduction to database systemsConsiders questions how to design, implement and use Considers questions how to design, implement and use data intensive computer applicationsdata intensive computer applications..Majority of the practical tasks in industry require applying Majority of the practical tasks in industry require applying relatively not complex algorithms to huge amounts of relatively not complex algorithms to huge amounts of well structured data.Accordingly, efficiency of an well structured data.Accordingly, efficiency of an application depends on the quality of (logical and application depends on the quality of (logical and physical) data organization.physical) data organization.

1010

Page 11: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Why Learn Database SystemsWhy Learn Database Systems

Wherever you go, there are databases:Wherever you go, there are databases:

– Student recordsStudent records– Airlines and hotels reservations,Airlines and hotels reservations,– Bank accountsBank accounts

– One of the first things people will ask you in an job interview is:One of the first things people will ask you in an job interview is:

““What do you know about databases?”What do you know about databases?”Databases are a matured area with a sound theoretical Databases are a matured area with a sound theoretical foundation and great practical knowledge.foundation and great practical knowledge.

1111

Page 12: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

المقرر المقرر محتويات محتويات

قواعد. 11 ومستخدمي البيانات لقواعد العامة قواعد. المفاهيم ومستخدمي البيانات لقواعد العامة المفاهيمالبياناتالبيانات

Chapter (1):Databases and Database UsersChapter (1):Databases and Database Users 1.11.1 IntroductionIntroduction . .1.21.2 An exampleAn example..

1.31.3 Characteristics of Database ApproachCharacteristics of Database Approach..1.41.4 Actors on the SceneActors on the Scene . .

1.51.5 Workers behind the SceneWorkers behind the Scene1.61.6 Advantages of using a DBMSAdvantages of using a DBMS

1.71.7 A Brief History of DB ApplicationA Brief History of DB Application1.81.8 When Not to Use a DBMSWhen Not to Use a DBMS

1212

Page 13: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..ومعماريتها. 22 البيانات قواعد نظم ومعماريتها. مفاهيم البيانات قواعد نظم مفاهيم

Chapter(2) : Database Systems Concepts and Chapter(2) : Database Systems Concepts and ArchitectureArchitecture

2.1Data Models, Schemas, and Instances.2.1Data Models, Schemas, and Instances.

2.2Three-schema Architecture and Data Independence.2.2Three-schema Architecture and Data Independence.

2.3 Database Languages and Interfaces.2.3 Database Languages and Interfaces.

2.4 The Database system environment2.4 The Database system environment

2.5 Centralized and Client /Server Architecture for 2.5 Centralized and Client /Server Architecture for DBMSs. DBMSs.

2.6 Classification of Database Management Systems2.6 Classification of Database Management Systems

1313

Page 14: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

المرتبطة. 33 الكائنات المرتبطة. نموذج الكائنات نموذجChapter(3): Data Modeling Using The Entity Relationship Chapter(3): Data Modeling Using The Entity Relationship

(ER) Model(ER) Model . .3.13.1 Using High-Level Conceptual Data Models for Database Using High-Level Conceptual Data Models for Database

DesignDesign . .3.23.2 An Example Database ApplicationAn Example Database Application

3.33.3 Entity Types, Entity Sets, Attributes, and KeysEntity Types, Entity Sets, Attributes, and Keys . .3.43.4 Relationships, Relationship Types, Roles, and Structural Relationships, Relationship Types, Roles, and Structural

ConstraintsConstraints..3.53.5 Weak Entity TypesWeak Entity Types . .

3.63.6 Refining the ER Design for the COMPANY DatabaseRefining the ER Design for the COMPANY Database . .3.73.7 ER Diagrams, Naming Conventions, and Design IssuesER Diagrams, Naming Conventions, and Design Issues . .

3.93.9 Relationship Types of degree higher than twoRelationship Types of degree higher than two . .

1414

Page 15: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

44 . المحسن المرتبطة الكائنات .نموذج المحسن المرتبطة الكائنات نموذجChapter(4): Enhanced Entity Relationship(EER) ModelChapter(4): Enhanced Entity Relationship(EER) Model . .

1515

Page 16: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont . .

العالئقي. 55 العالئقي. النموذج النموذج

Chapter(5): Relational data Model and Chapter(5): Relational data Model and Relational ConstraintsRelational Constraints . .

.. 5.15.1 Relational Data Model ConceptsRelational Data Model Concepts

5.25.2 Relational Constraints and Relational Relational Constraints and Relational Database Database ..SchemasSchemas

5.35.3 Update Operations ,transaction ,and Dealing with Update Operations ,transaction ,and Dealing with Constraints ViolationsConstraints Violations

1616

Page 17: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

العالئقي 66 العالئقي الجبر الجبر

Chapter(6) the Relational Algebra AND relational calculusChapter(6) the Relational Algebra AND relational calculus

6.16.1 Unary Relational OperationsUnary Relational Operations . .

6.26.2 Relational Algebra Operations from set theoryRelational Algebra Operations from set theory..

6.36.3 binary Relational Operationsbinary Relational Operations ..

6.66.6 The Tuple Relational calculusThe Tuple Relational calculus..

6.76.7 the Domain Relational Calculusthe Domain Relational Calculus . .

1717

Page 18: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

contcont..

العالئقي. 77 النموذج الي الكائنات نموذج العالئقي. تحويل النموذج الي الكائنات نموذج تحويلChapter (7): ER to Relational MappingChapter (7): ER to Relational Mapping..

7.17.1 Relational DB Design Using ER –to- Relational Relational DB Design Using ER –to- Relational MappingMapping..

7.27.2 Mapping EER Model Constructs to RelationMapping EER Model Constructs to Relation..

1818

Page 19: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

contcont..

الهيكلية. 88 االستفسارات الهيكلية. لغة االستفسارات لغةChapter (8) :Chapter (8) :Structured Query Language SQL-Structured Query Language SQL-99:schema Definition, constraints , queries, and views99:schema Definition, constraints , queries, and views..

8.18.1 SQL Data Definitions , Constraints and data typesSQL Data Definitions , Constraints and data types 8.28.2 Specifying Constraints In SQLSpecifying Constraints In SQL..

8.38.3 schema change statements in SQLschema change statements in SQL..8.48.4 Basic Queries in SQLBasic Queries in SQL..

8.58.5 More Complex SQL QueriesMore Complex SQL Queries..8.68.6 Insert . Delete , And Update Statements In SQLInsert . Delete , And Update Statements In SQL..

8.88.8 Views (Virtual Table) In SQLViews (Virtual Table) In SQL..

1919

Page 20: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

والتبسيط. 99 الدالي والتبسيط. االعتماد الدالي االعتمادChapter(10):Functional Dependencies and Chapter(10):Functional Dependencies and Normalization for relational DatabasesNormalization for relational Databases..

10.110.1 Informal Design Guidelines for Relation Informal Design Guidelines for Relation SchemasSchemas..

10.210.2 Functional DependenciesFunctional Dependencies..

..10.310.3 Normal forms Based on Primary KeysNormal forms Based on Primary Keys

10.410.4 General Definitions of Second and Third Normal General Definitions of Second and Third Normal FormsForms..

2020

Page 21: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

الرحيم الرحمن الله الرحيم بسم الرحمن الله بسم

2121

Page 22: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Lecture(2)Lecture(2) Chapter 1 Chapter 1

Introduction: Databases and Introduction: Databases and Database UsersDatabase Users

2222

Page 23: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

IntroductionIntroduction

كالبنوك , المختلفة الموؤسسات معظم في البيانات قواعد نظم كالبنوك , تستخدم المختلفة الموؤسسات معظم في البيانات قواعد نظم تستخدم.......... , , الخ المصانع الجوي الحجز مكاتب التعليمية ..........الموؤسسات , , الخ المصانع الجوي الحجز مكاتب التعليمية الموؤسسات

))databases plays a critical rule in almost all areas where computers are databases plays a critical rule in almost all areas where computers are used ,including business ,ecommerce, engineering, medicine,…etcused ,including business ,ecommerce, engineering, medicine,…etc((

: نصوص إما البيانات البيانات قواعد لنظم التقليدية : التطبيقات نصوص إما البيانات البيانات قواعد لنظم التقليدية اوارقام) اوارقام) ))texttextالتطبيقاتnumbersnumbers((.(.(

: البيانات قواعد لنظم الحديثة للتطبيقات :امثلة البيانات قواعد لنظم الحديثة للتطبيقات امثلةMultimedia DB systems Multimedia DB systems Geographical information system (GIS)Geographical information system (GIS)Data Warehousing And Data MiningData Warehousing And Data MiningInteraction Between DB And WWWInteraction Between DB And WWWReal time and Active DBsReal time and Active DBsTemporal DBsTemporal DBs •First part of book focuses on

traditional applications.•A number of recent applications are described later in the book (for example, Chapters 24,26,28,29,30)

2323

Page 24: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

General conceptsGeneral concepts

Definition of DBDefinition of DB : : collection of related data.collection of related data.البعض )) ببعضها العالقة ذات البيانات من مجموعة عن عبارة هي البياتات البعض قاعدة ببعضها العالقة ذات البيانات من مجموعة عن عبارة هي البياتات ..((قاعدة

this defn is more general.this defn is more general.

Essential database characteristics are:Essential database characteristics are:– Represents an aspect of the real world (miniworld, UoD),Represents an aspect of the real world (miniworld, UoD),– Well structured (even has a strict regular structure),Well structured (even has a strict regular structure),– Reflects (or should reflect) current state of the UoD,Reflects (or should reflect) current state of the UoD,– Has users and applications, Has users and applications, – Stored in a permanent (persistent) computer memory, andStored in a permanent (persistent) computer memory, and– Accessed and manipulated using a DBMSAccessed and manipulated using a DBMS

All these characteristics have to be metAll these characteristics have to be met

UOD :universe of discourseUOD :universe of discourseMini-world:Mini-world:– Some part of the real world about which data is stored in a database. Some part of the real world about which data is stored in a database.

2424

Page 25: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

What Is a DatabaseWhat Is a Database??

RealWorld

Database

Facts about world and behaviour of world

represented incontents and operations of a database

Users

StudentStudentLNameLName FNameFName StudIdStudId MajorMajor

AhmedAhmed AmnaAmna 04-1204-12 CompComp

AliAli OsmanOsman 02-3402-34 MathMath

A/ AllaA/ Alla EsraaEsraa 06-2006-20 StatStat 2525

Page 26: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Another definitionAnother definition:: A DB is a shared collection A DB is a shared collection of logically related data (and description of this of logically related data (and description of this data ),designed to meet the information needs of an data ),designed to meet the information needs of an

organization.organization.

2626

Page 27: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Definition of Data (Datum)Definition of Data (Datum)DataData is a value of a property of an individual UoD object is a value of a property of an individual UoD object or a relationship (between two UoD objects) at a or a relationship (between two UoD objects) at a particular period of time.particular period of time.

ExampleExample

UoD UoD object(s)object(s)

AliAli Ali & Ali & CompSci depCompSci dep

PropertyProperty AgeAge Number of Number of PointsPoints

TimeTime Feb Feb 20052005

Feb 2005Feb 2005

ValueValue 2121 2402402727

Page 28: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Another def of data:Another def of data:Data:Data:– Known facts that can be recorded and have an implicit meaningKnown facts that can be recorded and have an implicit meaning

AA database can be of any size and complexity, and it may be generated database can be of any size and complexity, and it may be generated manually or computerized.manually or computerized.

2828

Page 29: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database Management System (DBMS)Database Management System (DBMS)البيانات قواعد ادارة البيانات نظم قواعد ادارة نظم

A collection of programs that enable:A collection of programs that enable:– Defining (describing the structure),Defining (describing the structure),– Constructing (populating by data),Constructing (populating by data),– Manipulating (querying, updating),Manipulating (querying, updating),– Preserving consistency,Preserving consistency,– Protecting from misuse,Protecting from misuse,– Recovering from failure, andRecovering from failure, and– Concurrent usingConcurrent using

of a database.of a database.

2929

Page 30: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Another definitionAnother definition

DBMS: A software system that enables DBMS: A software system that enables users to define ,create, maintain the users to define ,create, maintain the database and provides controlled access database and provides controlled access to this database. to this database.

DBMS either general purpose or specific DBMS either general purpose or specific purpose software. purpose software.

3030

Page 31: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database systemsDatabase systemsالبيانات قواعد البيانات نظم قواعد نظم

DB+DBMS DB systemDB+DBMS DB system

Database System:The DBMS software together with the data itself. Sometimes, the applications are also included. 3131

Page 32: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Example of DBExample of DB

3232

Page 33: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Example of DBExample of DB

Mini-world for the example:Mini-world for the example:– Part of a UNIVERSITY environment.Part of a UNIVERSITY environment.

Some mini-world Some mini-world entitiesentities::– STUDENTsSTUDENTs– COURSEsCOURSEs– SECTIONs (of COURSEs)SECTIONs (of COURSEs)– (academic) DEPARTMENTs(academic) DEPARTMENTs– INSTRUCTORsINSTRUCTORs

3333

Page 34: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Example of DBExample of DB

Some mini-world Some mini-world relationshipsrelationships::– SECTIONs SECTIONs are of specificare of specific COURSEs COURSEs

– STUDENTs STUDENTs taketake SECTIONs SECTIONs

– COURSEs COURSEs have prerequisitehave prerequisite COURSEs COURSEs

– INSTRUCTORs INSTRUCTORs teachteach SECTIONs SECTIONs

– COURSEs COURSEs are offered byare offered by DEPARTMENTs DEPARTMENTs

– STUDENTs STUDENTs major inmajor in DEPARTMENTs DEPARTMENTs

3434

Page 35: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Characteristics of the DB approachCharacteristics of the DB approach

Difference between DB systems(DB approach) and file-Difference between DB systems(DB approach) and file-based systems (traditional file processing).based systems (traditional file processing).

Definition of fileDefinition of file--based system: A collection of based system: A collection of application programs that perform services for the application programs that perform services for the end-users such as production of reports. Each end-users such as production of reports. Each program defines and manages its own data. program defines and manages its own data.

3535

Page 36: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

An example of file based systemAn example of file based system

File definition

Academic office

Academic office files

Data entry and reports

File handling routines

File definition

Account office

Account office files

Data entry and reports

File handling routines

File definition

3636

Page 37: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

التقليدية؟ الملفات نظم عيوب التقليدية؟ ماهي الملفات نظم عيوب ماهي1.1. Separation and isolation of data.Separation and isolation of data.

2.2. Duplication of data.Duplication of data.

3.3. Data dependence.Data dependence.

4.4. Incompatibility of files.Incompatibility of files.

5.5. Fixed queries.Fixed queries.

3737

Page 38: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

DB ApproachDB Approach

Arose because:Arose because:– Definition of data was embedded in application programs, rather Definition of data was embedded in application programs, rather

than being stored separately and independently.than being stored separately and independently.– No control over access and manipulation of data beyond that No control over access and manipulation of data beyond that

imposed by application programs.imposed by application programs.

Result: Result: – the database and Database Management System (DBMS).the database and Database Management System (DBMS).

3838

Page 39: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

DB ApproachDB Approach

Academic office

Academic office files and account office files and files defn

Data entry and reports

Account office

Data entry and reports

DBMASDBMAS

DBDBAcademic application programs

Account application programs

DB SYSTEMDB SYSTEM

3939

Page 40: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Comparison between DB approach and TFP Comparison between DB approach and TFP approachapproach

The main characteristics of DB approach versus TFP The main characteristics of DB approach versus TFP approach are:approach are:

1.1. Self-Describing Nature of a Database SystemSelf-Describing Nature of a Database System – – In addition to DB ,DB system has a complete definition or description of the In addition to DB ,DB system has a complete definition or description of the

database structure and constraints. database structure and constraints. • DB definition is stored in the system catalog, which contains information DB definition is stored in the system catalog, which contains information

such as the structure of each file, the type and storage format of each such as the structure of each file, the type and storage format of each data item, and various constraints on the data. data item, and various constraints on the data.

This allows the DBMS software to work with different database This allows the DBMS software to work with different database applications.applications.

• (Fig 1.1). (Fig 1.1). • In TFP .data defn is a part of application program , ie these programs are In TFP .data defn is a part of application program , ie these programs are

constrained to work with only on DB.constrained to work with only on DB.

4040

Page 41: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

An example of a database catalogAn example of a database catalog

4141

Page 42: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

2.2. Insulation between Programs and Data Insulation between Programs and Data • Called Called program-data independenceprogram-data independence. . • Allows changing data structures and storage organization Allows changing data structures and storage organization

without having to change the DBMS access programs.without having to change the DBMS access programs.• The structure of data files is stored in the DBMS catalog The structure of data files is stored in the DBMS catalog

separately from the access programs. separately from the access programs. • In TFP changes the structure of file may require changing In TFP changes the structure of file may require changing

all access programs.all access programs.

4242

Page 43: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

3.3. Data Abstraction: A data model is used to hide storage Data Abstraction: A data model is used to hide storage details and present the users with a conceptual view details and present the users with a conceptual view of the database. of the database.

4.4. Support of Multiple Views of the Data - Each users Support of Multiple Views of the Data - Each users may see a different view of the database, which may see a different view of the database, which describes only the data of interest to that user. (fig 1.describes only the data of interest to that user. (fig 1.55) )

4343

Page 44: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

4444

Page 45: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

Sharing of data and multi-user transaction Sharing of data and multi-user transaction processing:processing:– Allowing a set of Allowing a set of concurrent usersconcurrent users to retrieve from and to to retrieve from and to

update the database.update the database.

– Concurrency controlConcurrency control within the DBMS guarantees that within the DBMS guarantees that each each transactiontransaction is correctly executed or aborted. is correctly executed or aborted.

– RecoveryRecovery subsystem ensures each completed transaction subsystem ensures each completed transaction has its effect permanently recorded in the database.has its effect permanently recorded in the database.

– OLTPOLTP (Online Transaction Processing) is a major part of (Online Transaction Processing) is a major part of database applications. This allows hundreds of concurrent database applications. This allows hundreds of concurrent transactions to execute per second.transactions to execute per second.

4545

Page 46: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

الرحيم الرحمن الله الرحيم بسم الرحمن الله بسم

4646

Page 47: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Lecture(3)Lecture(3) Chapter 1 Chapter 1

Introduction: Databases and Introduction: Databases and Database UsersDatabase Users

4747

Page 48: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database UsersDatabase Users

Users may be divided intoUsers may be divided into– Those who actually use and control the Those who actually use and control the

database content, and those who design, database content, and those who design, develop and maintain database applications develop and maintain database applications (called “Actors on the Scene”), and(called “Actors on the Scene”), and

– Those who design and develop the DBMS Those who design and develop the DBMS software and related tools, and the computer software and related tools, and the computer systems operators (called “Workers Behind systems operators (called “Workers Behind the Scene”).the Scene”).

4848

Page 49: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Actors on the SceneActors on the Scene

Database administrator (DBA):Database administrator (DBA):1-Administering the primary resource of DBsystem (DB itself) 1-Administering the primary resource of DBsystem (DB itself)

and DBMS (secondary resource).and DBMS (secondary resource).

2- responsible for authorizing access to the db, for coordinating 2- responsible for authorizing access to the db, for coordinating and monitoring its use.and monitoring its use.

3- responsible for acquiring software and hardware when 3- responsible for acquiring software and hardware when needed.needed.

4-Solving the problems of the system such as security or poor 4-Solving the problems of the system such as security or poor system response time. system response time.

4949

Page 50: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

DB designers:DB designers: Responsible to define the content, the structure, the Responsible to define the content, the structure, the

constraints, and functions or transactions against the constraints, and functions or transactions against the database. They must communicate with the end-users database. They must communicate with the end-users and understand their needs.and understand their needs.

..

5050

Page 51: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Categories of End-usersCategories of End-users

End usersEnd users:: - - people whose jobs require access to the people whose jobs require access to the database for querying, updating, and generating reports. database for querying, updating, and generating reports.

There are several categories of end users :There are several categories of end users :

1.1. Casual end users (not formal): Casual end users (not formal): access db from time to access db from time to time (like managers)time (like managers)

2.2. Naive or ParametricNaive or Parametric: they make up a large section of the : they make up a large section of the end-user population.end-user population.

– They use previously well-defined functions in the They use previously well-defined functions in the form of “canned transactions” against the form of “canned transactions” against the database.database.

– Examples are bank-tellers or reservation clerksExamples are bank-tellers or reservation clerks..

5151

Page 52: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Categories of End-users (continued)Categories of End-users (continued)

4.4. Sophisticated:Sophisticated:– These include business analysts, scientists, engineers, These include business analysts, scientists, engineers,

others thoroughly familiar with the system capabilities.others thoroughly familiar with the system capabilities.– Many use tools in the form of software packages that Many use tools in the form of software packages that

work closely with the stored database.work closely with the stored database.

5.5. Stand-alone:Stand-alone:– Mostly maintain personal databases using ready-to-use Mostly maintain personal databases using ready-to-use

packaged applications.packaged applications.– An example is a tax program user that creates its own An example is a tax program user that creates its own

internal database.internal database.

5252

Page 53: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Cont.Cont.

System Analysts and Application Programmers System Analysts and Application Programmers (Software Engineers) (Software Engineers) - System analysts determine - System analysts determine the requirements of end users, and develop the requirements of end users, and develop specifications for transactions. Application programmers specifications for transactions. Application programmers implement these specifications and programs. Such implement these specifications and programs. Such analysts and programmers nowadays called analysts and programmers nowadays called software software engineersengineers. .

  read section 1.5.read section 1.5.

5353

Page 54: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Advantages of using DBMSAdvantages of using DBMS

1.1. Controlling redundancy:Controlling redundancy: redundancy means that storing the same data multiple times in the redundancy means that storing the same data multiple times in the

DB.DB. Redundancy problems:Redundancy problems:

1-Duplication of efforts.1-Duplication of efforts.

2-storage space is wasting 2-storage space is wasting

3-Inconsistency of data3-Inconsistency of data In DB approach: store each logical data item (such as a student's In DB approach: store each logical data item (such as a student's

name) in name) in only one placeonly one place.. In some cases redundancy is necessary to improve system In some cases redundancy is necessary to improve system

performance and DBMS has capability to control such performance and DBMS has capability to control such redundancy. FIGURE(1.redundancy. FIGURE(1.66))

5454

Page 55: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

5555

Page 56: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

2.2. Restricting Unauthorized Access:- Restricting Unauthorized Access:- the DBA uses the DBA uses security and authorization subsystem security and authorization subsystem

(provided by DBMS) in order to specify account (provided by DBMS) in order to specify account restrictions.restrictions.

3.3. Providing Persistent Storage for Program Objects Providing Persistent Storage for Program Objects and Data Structuresand Data Structures.. Compatibility between ODBMS (object Compatibility between ODBMS (object store) and OOPL(C++,JAVA). store) and OOPL(C++,JAVA).

4.4. Permitting Inferencing and actions Using Rules :-Permitting Inferencing and actions Using Rules :-

capability for defining deduction rules for inferenccapability for defining deduction rules for inferencing ing new information new information from the stored database facts. (active DB system ).from the stored database facts. (active DB system ).

5656

Page 57: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

CONTCONT..

5.5. Providing Storage Structures For Efficient Query Providing Storage Structures For Efficient Query Processing:Processing:

• DB is stored on disk, so DBMS must provide DB is stored on disk, so DBMS must provide specialized data structures to speed up disk search.specialized data structures to speed up disk search.

• DBMS often has a buffering module that maintains DBMS often has a buffering module that maintains parts of the DB in memory buffers.parts of the DB in memory buffers.

• Query processing and optimization moduleQuery processing and optimization module of the of the DBMS is responsible for choosing an efficient query DBMS is responsible for choosing an efficient query execution plan for each query.execution plan for each query.

• Choosing appropriate data structure is a part of physical Choosing appropriate data structure is a part of physical DB design and tuning . (responsibility of DBA staff).DB design and tuning . (responsibility of DBA staff).

5757

Page 58: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

6.6. Providing Multiple User InterfacesProviding Multiple User Interfaces :- :-

to satisfy users with varying levels of technical knowledge.to satisfy users with varying levels of technical knowledge.

Interfaces for casual users, form style and menu driven Interfaces for casual users, form style and menu driven (GUIs).(GUIs).

7.7. Representing Complex Relationships Among Representing Complex Relationships Among DataData:-:-

AA DBMSDBMS must have the capability to represent a must have the capability to represent a variety of complex relationships among the data as variety of complex relationships among the data as well as to retrieve and update related data easily and well as to retrieve and update related data easily and efficiently. efficiently.

5858

Page 59: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

7.7. Enforcing Integrity Constraints:-Enforcing Integrity Constraints:-

capability for defining and enforcing constraints capability for defining and enforcing constraints

(e.g., specifying a data type for each data item). (e.g., specifying a data type for each data item).

8.8. Providing Backup and Recovery:-Providing Backup and Recovery:-

AA DBMSDBMS must provide facilities for recovering from must provide facilities for recovering from hardware or software failures. hardware or software failures.

The backup and recovery subsystem The backup and recovery subsystem o f a DBMS is o f a DBMS is responsible for recovery.responsible for recovery.

5959

Page 60: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Additional Implications of Using the DatabaseAdditional Implications of Using the Database ApproachApproach

Potential for enforcing standards:Potential for enforcing standards:

– This is very This is very importantimportant for the success of database for the success of database applications in large organizations. applications in large organizations. StandardsStandards refer to refer to data item names, display formats, screens, report data item names, display formats, screens, report structures, meta-data (description of data), Web page structures, meta-data (description of data), Web page layouts, etc.layouts, etc.

Reduced application development time:Reduced application development time:

– Incremental time to add each new application is reduced.Incremental time to add each new application is reduced.

6060

Page 61: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Additional Implications of Using the Database Additional Implications of Using the Database Approach (continued)Approach (continued)

Flexibility to change data structures:Flexibility to change data structures:

– Database structure may evolve as new requirements are Database structure may evolve as new requirements are defined. defined.

Availability of current information:Availability of current information:

– Extremely important for on-line transaction systems such Extremely important for on-line transaction systems such as airline, hotel, car reservations.as airline, hotel, car reservations.

Economies of scale:Economies of scale:

– Wasteful overlap of resources and personnel can be Wasteful overlap of resources and personnel can be avoided by consolidating data and applications across avoided by consolidating data and applications across

departmentsdepartments..

6161

Page 62: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Historical Development of Database Historical Development of Database TechnologyTechnology

Early Database Applications:Early Database Applications:– The Hierarchical and Network Models were introduced in The Hierarchical and Network Models were introduced in

mid 1960s and dominated during the seventies.mid 1960s and dominated during the seventies.

– A bulk of the worldwide database processing still occurs A bulk of the worldwide database processing still occurs using these models, particularly, the hierarchical model.using these models, particularly, the hierarchical model.

Relational Model based Systems:Relational Model based Systems:– Relational model was originally introduced in 1970, was Relational model was originally introduced in 1970, was

heavily researched and experimented within IBM Research heavily researched and experimented within IBM Research and several universities.and several universities.

– Relational DBMS Products emerged in the early 1980s.Relational DBMS Products emerged in the early 1980s.

6262

Page 63: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Historical Development of Database Historical Development of Database Technology (continued)Technology (continued)

Object-oriented and emerging applications:Object-oriented and emerging applications:– Object-Oriented Database Management Systems Object-Oriented Database Management Systems

(OODBMSs) were introduced in late 1980s and early (OODBMSs) were introduced in late 1980s and early 1990s to cater to the need of complex data processing in 1990s to cater to the need of complex data processing in applications.applications.

– Many relational DBMSs have incorporated object database Many relational DBMSs have incorporated object database concepts, leading to a new category called concepts, leading to a new category called object-object-relationarelational DBMSs (ORDBMSs)l DBMSs (ORDBMSs)

– Extended relationalExtended relational systems add further capabilities (e.g. systems add further capabilities (e.g. for multimedia data, XML, and other data types)for multimedia data, XML, and other data types)

6363

Page 64: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Historical Development of Database Historical Development of Database Technology (continued)Technology (continued)

Data on the Web and E-commerce Applications:Data on the Web and E-commerce Applications:– Web contains data in HTML (Hypertext markup language) Web contains data in HTML (Hypertext markup language)

with links among pages.with links among pages.– This has given rise to a new set of applications and E-This has given rise to a new set of applications and E-

commerce is using new standards like XML (eXtended commerce is using new standards like XML (eXtended Markup Language). (see Ch. 27).Markup Language). (see Ch. 27).

– Script programming languages such as PHP and Script programming languages such as PHP and JavaScript allow generation of dynamic Web pages that JavaScript allow generation of dynamic Web pages that are partially generated from a database (see Ch. 26).are partially generated from a database (see Ch. 26).

Also allow database updates through Web pageAlso allow database updates through Web pagess..

6464

Page 65: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Extending Database CapabilitiesExtending Database Capabilities

New functionality is being added to DBMSs in the following areas:New functionality is being added to DBMSs in the following areas:– Scientific ApplicationsScientific Applications– XML (eXtensible Markup Language)XML (eXtensible Markup Language)– Image Storage and ManagementImage Storage and Management– Audio and Video Data ManagementAudio and Video Data Management– Data Warehousing and Data MiningData Warehousing and Data Mining– Spatial Data ManagementSpatial Data Management– Time Series and Historical Data ManagementTime Series and Historical Data Management

The above gives rise to The above gives rise to new research and developmentnew research and development in in incorporating new data types, complex data structures, new incorporating new data types, complex data structures, new operations and storage and indexing schemes in database systems. operations and storage and indexing schemes in database systems.

6565

Page 66: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

When Not To Use a DBMSWhen Not To Use a DBMS

Disadvantages Of DBMS:Disadvantages Of DBMS:

High initial investment in hardware, software, and High initial investment in hardware, software, and training. training.

Generality that a DBMS provides for defining and Generality that a DBMS provides for defining and processing data. processing data.

Overhead for providing security, concurrency control, Overhead for providing security, concurrency control, recovery, and integrity functions.recovery, and integrity functions.

6666

Page 67: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

contcont..

The following are the situations where the The following are the situations where the using of a DBMS is not suitable:-using of a DBMS is not suitable:-

1.1. The database and applications are simple, well The database and applications are simple, well defined, and not expected to change. defined, and not expected to change.

2.2. Real-time requirements for some program may not be Real-time requirements for some program may not be met because of DBMS overhead. met because of DBMS overhead.

3.3. Multiple-user access to data is not required. Multiple-user access to data is not required.

6767

Page 68: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

contcont..

When no DBMS may suffice:When no DBMS may suffice:

– If the database system is not able to handle the complexity If the database system is not able to handle the complexity of data because of modeling limitations.of data because of modeling limitations.

– If the database users need special operations not If the database users need special operations not supported by the DBMS.supported by the DBMS.

6868

Page 69: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Good bye Good bye chapter onechapter one

6969

Page 70: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Chapter(2) :Chapter(2) :

Database system concepts Database system concepts and architecture.and architecture.

7070

Page 71: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Data ModelsData Models

Database approach provides some level of data abstraction Database approach provides some level of data abstraction by hiding details of data storage. by hiding details of data storage.

Data Model:Data Model:

– A set of concepts to describe the A set of concepts to describe the structurestructure of a database, of a database, the the operations operations for manipulating these structures, and for manipulating these structures, and certain certain constraintsconstraints that the database should obey that the database should obey

–( البيانات ( قاعدة بنية لوصف تستخدم المفاهيم من )مجموعة البيانات ( قاعدة بنية لوصف تستخدم المفاهيم من مجموعة

Data Model Structure and Constraints:Data Model Structure and Constraints:

– Constructs are used to define the database structureConstructs are used to define the database structure

– Constructs typically include Constructs typically include elements elements (and their (and their data data typestypes) as well as groups of elements (e.g. ) as well as groups of elements (e.g. entity, record, entity, record, tabletable), and ), and relationshipsrelationships among such groups among such groups

– Constraints specify some restrictions on valid data; these Constraints specify some restrictions on valid data; these constraints must be enforced at all timesconstraints must be enforced at all times

7171

Page 72: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Data Models (continued)Data Models (continued)

Data Model Operations:Data Model Operations:– These operations are used for specifying database These operations are used for specifying database

retrievalsretrievals and and updatesupdates by referring to the constructs of the by referring to the constructs of the data model.data model.

– Operations on the data model may include Operations on the data model may include basic model basic model operations operations (e.g. generic insert, delete, update) and(e.g. generic insert, delete, update) and user- user-defined operations defined operations (e.g. compute_student_gpa, (e.g. compute_student_gpa,

update_inventoryupdate_inventory))

7272

Page 73: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Categories of data modelCategories of data model

1.1. High-levelHigh-level or or conceptual data modelsconceptual data models 2.2. Low-levelLow-level or or physical data modelsphysical data models

3.3. RepresentationalRepresentational or or implementation data modelsimplementation data models

7373

Page 74: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

High-levelHigh-level or or conceptual data modelsconceptual data models

) المتخصص غير العادي المستخدم لفهم اقرب النوع هذا في ( المفاهيم المتخصص غير العادي المستخدم لفهم اقرب النوع هذا في المفاهيم. ( الحاسوب فى مباشرة8 المفاهيم هذه تطبق ال ولذا الحاسوب .في ( الحاسوب فى مباشرة8 المفاهيم هذه تطبق ال ولذا الحاسوب في– Provide concepts that are close to the way many users Provide concepts that are close to the way many users

perceive data. perceive data. (Also called (Also called entity-basedentity-based oror object-basedobject-based data data models.)models.)

. البيانات قاعدة لتصميم الثانية الخطوة في النموذج هذا تحديد .يتم البيانات قاعدة لتصميم الثانية الخطوة في النموذج هذا تحديد يتم

) الكائنات: نموذج (امثلة الكائنات: نموذج entity relationship modelentity relationship model((امثلة

المحسن الكائنات المحسن نموذج الكائنات )) ) ) enhanced entity relationship modelenhanced entity relationship modelنموذج

7474

Page 75: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Low-levelLow-level or or physical data modelsphysical data models

عن التفاصيل كل بوصف تتعلق النوع هذا في عن المفاهيم التفاصيل كل بوصف تتعلق النوع هذا في المفاهيم. الحاسوب في البيانات تخزين .كيفية الحاسوب في البيانات تخزين كيفية

, الوصول وممرات السجالت تنظيم السجالت نسق , يوصف الوصول وممرات السجالت تنظيم السجالت نسق يوصفللسجالت للسجالت

))))access pathsaccess paths– Provide concepts that describe details of how data is stored in Provide concepts that describe details of how data is stored in

the computer. These are usually specified in an ad-hoc the computer. These are usually specified in an ad-hoc manner through DBMS design and administration manualsmanner through DBMS design and administration manuals

unifying model, frame memoryunifying model, frame memoryامثلة :امثلة :

7575

Page 76: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

RepresentationalRepresentational or or implementation data implementation data modelsmodels

. ولكن العادي المستخدم بواسطة تفهم قد النوع هذا في . المفاهيم ولكن العادي المستخدم بواسطة تفهم قد النوع هذا في المفاهيمفى مباشرة8 المفاهيم هذه تطبق و التخزين تفاصيل كل فى التخفي مباشرة8 المفاهيم هذه تطبق و التخزين تفاصيل كل التخفي

الحاسوب.الحاسوب.

.DBMSDBMSاي اي بها خاص تطبيقي نموذج .لها بها خاص تطبيقي نموذج لها

عليها يطلق ولذ البيانات لوصف السجالت النماذج هذه في عليها تستخدم يطلق ولذ البيانات لوصف السجالت النماذج هذه في تستخدم

))Record-based data modelsRecord-based data models.(.(

Provide concepts that fall between the above two, used by many Provide concepts that fall between the above two, used by many commercial DBMS implementations .commercial DBMS implementations .

امثلة:امثلة:

relational modelrelational model )ال معظم في ال( يستخدم معظم في الحالية).الحالية). DBMSDBMSيستخدم

Hierarchical and network modelsHierarchical and network models .( القديمة( االنظمة في ).تستخدم القديمة( االنظمة في تستخدم

Object modelsObject models )ال في ال( تستخدم في ))ODBMSODBMSتستخدم

7676

Page 77: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Schemas, Instances, and Database StateSchemas, Instances, and Database State

البيانات – قاعدة البيانات خارطة قاعدة وصف): وصف): ))database schemadatabase schemaخارطةالبيانات البيانات قاعدة ))description of databasedescription of database((قاعدة

Includes descriptions of the database structure, data types, Includes descriptions of the database structure, data types, and the constraints on the database.and the constraints on the database.

8 نادرا وهي البيانات قاعدة تصميم اثناء البيانات قاعدة خارطة 8 تحدد نادرا وهي البيانات قاعدة تصميم اثناء البيانات قاعدة خارطة تحددتحديث . بها تحديث .مايحدث بها مايحدث

رسم عن عبارة الخارطة تكون البيانات نماذج معظم رسم في عن عبارة الخارطة تكون البيانات نماذج معظم فيdiagramdiagram ( (توضيحي(توضيحي(

Schema Diagram:Schema Diagram:– An An illustrativeillustrative display of (most aspects of) a database display of (most aspects of) a database

schema.schema.

7777

Page 78: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

ContCont..

Schema Construct:Schema Construct:– A A componentcomponent of the schema or an object within the of the schema or an object within the

schema, e.g., STUDENT, COURSE.schema, e.g., STUDENT, COURSE.

7878

Page 79: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Schemas versus InstancesSchemas versus Instances

Database StateDatabase State::

– The actual data stored in a database at a The actual data stored in a database at a particular particular moment in timemoment in time. This includes the collection of all the . This includes the collection of all the data in the database.data in the database.

معينة – لحظة فى البيانات قاعدة في معينة البيانات لحظة فى البيانات قاعدة في ..البيانات– Also called database instance (or occurrence or snapshot).Also called database instance (or occurrence or snapshot).

The term The term instance instance is also applied to individual is also applied to individual database components, e.g. database components, e.g. record instance, table record instance, table instance, entity instance.instance, entity instance.

7979

Page 80: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database Schema Database Schema vs. Database Statevs. Database State

Database StateDatabase State: : – Refers to the Refers to the contentcontent of a database at a moment in of a database at a moment in

time.time.

Initial Database State:Initial Database State:– Refers to the database state when it is initially loaded Refers to the database state when it is initially loaded

into the system.into the system.

Valid State:Valid State:

– A state that satisfies the structure and constraints of the A state that satisfies the structure and constraints of the

databasedatabase..صحيحة DBMSDBMSال ال – 8 دائما البيانات قاعدة حالة ان التأكد صحيحة مهمتها 8 دائما البيانات قاعدة حالة ان التأكد valid valid ( (مهمتها

statestate ( (. الخارطة على الموضحة القيود من قيد أي خرق بعدم .وذلك الخارطة على الموضحة القيود من قيد أي خرق بعدم وذلك

8080

Page 81: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Database Schema Database Schema vs. Database State (continued)vs. Database State (continued)

DistinctionDistinction

– The The database schemadatabase schema changes very infrequently. changes very infrequently.

– The The database statedatabase state changes every time the database is changes every time the database is updated. updated.

SchemaSchema is also called is also called intensionintension..

StateState is also called is also called extensionextension..

8181

Page 82: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Example of a Database SchemaExample of a Database Schema

8282

Page 83: بسم الله الرحمن الرحيم 1. Lecture (1) 2 Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it. 3

Example of a database stateExample of a database state

8383