+ All Categories
Home > Documents > بسم الله الرحمن الرحيم. Welcome Welcome to حسب304 An Introduction to...

بسم الله الرحمن الرحيم. Welcome Welcome to حسب304 An Introduction to...

Date post: 20-Jan-2016
Category:
Upload: amanda-summers
View: 223 times
Download: 0 times
Share this document with a friend
64
م ي ح ر ل ا ن م ح ر ل ه ا ل ل م ا س ب م ي ح ر ل ا ن م ح ر ل ه ا ل ل م ا س ب
Transcript
Page 1: بسم الله الرحمن الرحيم. Welcome Welcome to حسب304 An Introduction to databases. We hope you will enjoy it.

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

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

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.

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

Information about courseInformation about course

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

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

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

Database course - PeopleDatabase course - People

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

Email :[email protected].

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

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

ContCont..

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

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

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

الفصلي الحضور 5%

تمارين 15%

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

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

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

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

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

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

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

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

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

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

: االساسي :المرجع االساسي المرجع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 .

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

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 applicationsMajority 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.

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

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 knowledgefoundation and great practical knowledge

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

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

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

Chapter (1):Databases and Database UsersChapter (1):Databases and Database Users1.11.1 IntroductionIntroduction

1.21.2 An exampleAn example1.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 Scene

1.61.6 Advantages of using a DBMSAdvantages of using a DBMS1.71.7 A Brief History of DB ApplicationA Brief History of DB Application

1.81.8 When Not to Use a DBMSWhen Not to Use a DBMS

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

ContCont..

ومعماريتها. 22 البيانات قواعد نظم ومعماريتها. مفاهيم البيانات قواعد نظم مفاهيمChapter(2) : Chapter(2) : Database Systems Concepts and Database Systems Concepts and ArchitectureArchitecture

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

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

2.3 Database Languages and Interfaces2.3 Database Languages and Interfaces

2.6 Classification of Database Management 2.6 Classification of Database Management SystemsSystems

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

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 . .

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

ContCont..

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

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

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 SchemasDatabase Schemas

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

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

العالئقي 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 AlgebraRelational Algebra Operations from set theoryOperations from set theory

6.36.3 binary Relational Operationsbinary Relational Operations

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

contcont..

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

7.17.1 relational DB design using ER –to- relational DB design using ER –to- Relational MappingRelational Mapping..

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

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..

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

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 General Definitions of Second and Third Normal FormsNormal Forms..

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

تمارينتمارين

. .11 (chapter(chapterقراءة ) قراءة ) ((11))

معملي( )22 ) ) معملي( )تمرين ( :( :11تمرين

بلغة برنامجا بلغة أكتب برنامجا بيانات ++++CCأكتب لتخزين ملفا بيانات ينشئ لتخزين ملفا طالب طالب 3030ينشئ , الطالب إسم حقول علىخمسة للطالب سجل أي يحتوي , حيث الطالب إسم حقول علىخمسة للطالب سجل أي يحتوي حيث . , الملف, , هذا يقوم 8 وايضا وعنوانه عمره الدراسي عامه . رقمه , الملف, , هذا يقوم 8 وايضا وعنوانه عمره الدراسي عامه رقمه

بيانات بيانات بتخزين , 2020بتخزين للمقرر سجل أي للطالب تدرس , مقرر للمقرر سجل أي للطالب تدرس مقرر , والسنة , المقرر رقم المقرر إسم حقول ثالثة على , يحتوي والسنة , المقرر رقم المقرر إسم حقول ثالثة على يحتوي

. بها يدرس التي .الدراسية بها يدرس التي الدراسية

بصورة حفظها تم أنه من تأكد الملف في البيانات كتابة بصورة بعد حفظها تم أنه من تأكد الملف في البيانات كتابة بعدعلى وإستعراضها الملف من قراءتها طريق عن على سليمة وإستعراضها الملف من قراءتها طريق عن سليمة

واسماء وارقامهم الطالب اسماء به تقرير شكل على واسماء الشاشة وارقامهم الطالب اسماء به تقرير شكل على الشاشةطالب . اسماء 8 ايضا استعرض ثم يدرسونها التي طالب . المقررات اسماء 8 ايضا استعرض ثم يدرسونها التي المقررات

االولى االولى السنة . السنة االعمار حسب .مرتبة االعمار حسب مرتبة

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

CHAPTER (1)CHAPTER (1)

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

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 WWWActive DBsActive DBsTemporal DBsTemporal DBs

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

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 discourse

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

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

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

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.

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

Definition of Data (Datum)Definition of Data (Datum)

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

ExampleExampleUoD 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 240240

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

درجة تختلف كما البيانات قواعد أحجام درجة تختلف تختلف كما البيانات قواعد أحجام تختلفتعقيدها.تعقيدها.

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

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.

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

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.

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

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

DB+DBMS DB systemDB+DBMS DB system

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

Example of DBExample of DB

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

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.

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

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

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

التقليدية؟ الملفات نظم عيوب التقليدية؟ ماهي الملفات نظم عيوب ماهي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

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

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 - it has a - it has a complete definition or description of the database structure complete definition or description of the database structure and constraints. This definition is stored in the system and constraints. This definition is stored in the system catalogcatalog, which contains information such as the structure of , which contains information such as the structure of each file, the type and storage format of each data item, and each file, the type and storage format of each data item, and various constraints on the data. This information stored in various constraints on the data. This information stored in the system catalog is called, the system catalog is called, Meta-dataMeta-data and it describes the and it describes the structure of the primary database. This allows the DBMS structure of the primary database. This allows the DBMS software to work with different databases (Fig 1.1) software to work with different databases (Fig 1.1)

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

Relation name No-of-columns

STUDENT 4

COURSE 4

SECTION 5

GRADE REPORTPREREQUISITE

32

Column-name Data-type Belong-to-relation

name Character(30) STUDENT

Student-number Character(4) STUDENT

Class Integer(1) STUDENT

Major Major-type STUDENT

Relations

Columns

An example of a database catalog

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

ContCont..

2.2. Insulation between Programs and Data and Data Insulation between Programs and Data and Data AbstractionAbstraction - Called - Called program-data independenceprogram-data independence. . Allows changing data storage structures and Allows changing data storage structures and operations without having to change the DBMS operations without having to change the DBMS access programs. The structure of data files is access programs. The structure of data files is stored in the DBMS catalog separately from the stored in the DBMS catalog separately from the access programs. access programs.

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

ContCont..

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

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

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

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

Lecture( 2)Lecture( 2)

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

ContCont..

5- Sharing of Data and Multiuser Transaction 5- Sharing of Data and Multiuser Transaction

ProcessingProcessing : :

These types of application is called online These types of application is called online transaction processing applications(OLTP)transaction processing applications(OLTP)

The DBMS must include The DBMS must include concurrency controlconcurrency control software to ensure that the result of multiuser software to ensure that the result of multiuser

access is correctaccess is correct . .

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

Database system usersDatabase system users

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

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

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

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

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

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

ContCont..

DB designers:DB designers:responsible for identifying the data to be stored and for choosing responsible for identifying the data to be stored and for choosing

appropriate structures to represent and store this data. This done appropriate structures to represent and store this data. This done after communicate with all db users in order to understand their after communicate with all db users in order to understand their requirements.requirements.

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

ContCont..

End users:End users: - - people whose jobs require access to people whose jobs require access to the database for querying, updating, and generating the database for querying, updating, and generating reports. reports. There are several categories of end users :There are several categories of end users :

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

2.2. Naïve or Parametric end users :querying and updates Naïve or Parametric end users :querying and updates db using standard types of queries (called canned db using standard types of queries (called canned transaction). transaction).

3.3. Sophisticated end users like engineers, scientists.Sophisticated end users like engineers, scientists.4.4. Stand alone users: using ready made program Stand alone users: using ready made program

packages(for example tax packagepackages(for example tax package((..

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

Cont.Cont.

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

  read section 1.5.read section 1.5.

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

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.5)redundancy. FIGURE(1.5)

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

ContCont..

2.2. Restricting Unauthorized Access:- Restricting Unauthorized Access:- the DBA uses security and authorization subsystem the DBA uses 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 Structures.and Data Structures. Compatibility between Compatibility between ODBMS )object store( and OOPL)C++,JAVA(. ODBMS )object 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 inferencing new capability for defining deduction rules for inferencing new information from the stored database facts. (active DB information from the stored database facts. (active DB system ).system ).

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

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 module of the Query processing and optimization module 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 Choosing appropriate data structure is a part of physical DB design and tuning . physical DB design and tuning .

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

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. 7-Representing Complex Relationships 7-Representing Complex Relationships Among Data:-a DBMS Among Data:-a DBMS must have the capability must have the capability to represent a variety of complex relationships among to represent a variety of complex relationships among the data as well as to retrieve and update related data the data as well as to retrieve and update related data easily and efficiently. easily and efficiently.

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

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. The backup and hardware or software failures. The backup and recovery subsystem o f a DBMS is responsible for recovery subsystem o f a DBMS is responsible for recovery.recovery.

Read section 1.7. Read section 1.7.

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

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.

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

contcont..

The following are the situations where The following are the situations where the using of a DBMS is not suitable:-the 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.

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

Good bye Good bye chapter onechapter one

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

Chapter(2) :Chapter(2) :

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

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

Database approach provides some level of data Database approach provides some level of data abstraction by hiding details of data storage. abstraction by hiding details of data storage. Data Model: A data model is a collection of concepts that Data Model: A data model is a collection of concepts that can be used to describe the structure of a database. By can be used to describe the structure of a database. By structure of a database we mean the data types, structure of a database we mean the data types, relationships, and constraints that should hold on the relationships, and constraints that should hold on the data. data.

( البيانات( قاعدة بنية لوصف تستخدم المفاهيم من )مجموعة البيانات( قاعدة بنية لوصف تستخدم المفاهيم من مجموعةSome Data models include a set of Some Data models include a set of basic operationsbasic operations for for specifying retrievals and updates on the database. specifying retrievals and updates on the database. Data models also allows the database designer to Data models also allows the database designer to specify a set of valid user defined operations on the specify a set of valid user defined operations on the database objects. database objects.

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

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

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

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

المستخدم لفهم اقرب النوع هذا في المستخدم المفاهيم لفهم اقرب النوع هذا في المفاهيم ( ال( ولذا الحاسوب في المتخصص غير ) العادي ال( ولذا الحاسوب في المتخصص غير العادي

. الحاسوب فى مباشرة8 المفاهيم هذه .تطبق الحاسوب فى مباشرة8 المفاهيم هذه تطبق

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

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

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

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

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

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

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

))))access pathsaccess paths

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

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

RepresentationalRepresentational or or implementation data implementation data modelsmodels

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

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

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

))Record-based data modelsRecord-based data models.(.( امثلة:امثلة:

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

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

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

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

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

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

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

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

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

بيانات قاعدة لخارطة بيانات مثال قاعدة لخارطة مثال

NameName StudnumberStudnumber ClassClass MajorMajor

CoursenameCoursename CoursenumberCoursenumber CredithoursCredithours DepartmentDepartment

CoursenumberCoursenumber Prerequisitenumber

StudnumberStudnumber CoursenumberCoursenumber SemnoSemno GradeGrade

student

course

prerequisite

Grade report

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

اعاله للخارطة البيانات اعاله قاعدة للخارطة البيانات قاعدة

NameName StudnumberStudnumber ClassClass MajorMajor

AliAli 04-4304-43 44 cscs

OsmanOsman 05-2405-24 22 statstat

Student

CoursenameCoursename CoursenumbCoursenumberer

CredithoursCredithours DepartmentDepartment

Introd to computer Introd to computer sciencescience

c102c102 44 CsCs

Data structureData structure c202c202 44 CsCs

Discrete mathDiscrete math c201c201 33 CsCs

Into to DBInto to DB c406c406 33 cscs

Course

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

ContCont..

StudnumberStudnumber CoursenumberCoursenumber SemnoSemno GradeGrade

04-4304-43 c406c406 11 AA

05-2405-24 c202c202 11 BB

CoursenumberCoursenumber Prerequisitenumber

c406c406 c102c102

c202c202 c102c102

Grade report

prerequisite

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

Database stateDatabase state

معينة لحظة فى البيانات قاعدة في معينة البيانات لحظة فى البيانات قاعدة في البياناتب ب تسمى database state, or database snapshot database state, or database snapshotتسمى

or current set of occurrences or instances in DBor current set of occurrences or instances in DB..

أي اعاله البيانات قاعدة أي في اعاله البيانات قاعدة schema schema ))فيconstructconstruct ) ) لها لهاset of instancesset of instances ..

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

بين بين الفرق : :database schemadatabase schema وال وال database statedatabase stateالفرق

في , الخارطة 8 اوال تحدد جديدة بيانات قاعدة اتشاء في , عند الخارطة 8 اوال تحدد جديدة بيانات قاعدة اتشاء عندال تكون اللحظة ال هذه تكون اللحظة ))empty stateempty state ( (خالية خالية DBstateDBstateهذه

تتحول االولية بالبيانات البيانات قاعدة تحميل تتحول بمجرد االولية بالبيانات البيانات قاعدة تحميل بمجردالى البيانات قاعدة الى حالة البيانات قاعدة تحديث , initial stateinitial stateحالة تحديث , أي أي

الى الى يحول new statenew stateيحول

DBMSDBMS 8ال ال دائما البيانات قاعدة حالة ان التأكد 8 مهمتها دائما البيانات قاعدة حالة ان التأكد مهمتهامن ) ) valid statevalid state ( (صحيحةصحيحة قيد أي خرق بعدم من وذلك قيد أي خرق بعدم وذلك

. الخارطة على الموضحة .القيود الخارطة على الموضحة القيود

. صحيح غير وتحديث صحيح لتحديث مثال .هات صحيح غير وتحديث صحيح لتحديث مثال هات


Recommended