chapter 1 databases and database users hour1
DESCRIPTION
Chapter 1 Databases and Database Users Hour1. Presented & Modified by Mahmoud Rafeek Alfarra Lecturer in CST Kan younis. Hour 1 Outline. Applications of database Concepts of Database. Applications of database. Traditional database applications Store textual or numeric information - PowerPoint PPT PresentationTRANSCRIPT
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Chapter 1
Databases and
Database Users
Hour1Presented & Modified by
Mahmoud Rafeek AlfarraLecturer in CST Kan younis
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Hour 1 OutlineHour 1 Outline
Applications of database Concepts of Database
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Applications of databaseApplications of database
Traditional database applications Store textual or numeric information
Multimedia databases Store images, audio clips, and video streams
digitally
Geographic information systems (GIS) Store and analyze maps, weather data, and
satellite images
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Applications of databaseApplications of database
Data warehouses and online analytical processing (OLAP) systems Extract and analyze useful business
information from very large databases Support decision making
Real-time and active database technology Control industrial and manufacturing processes
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
DB ConceptsDB Concepts
Database Collection of related data Known facts that can be recorded and that
have implicit meaning Miniworld or universe of discourse (UoD) Represents some aspect of the real world Logically coherent collection of data with
inherent meaning Built for a specific purpose
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
DB ConceptsDB Concepts
Database management system (DBMS) Collection of programs Enables users to create and maintain a
database
Defining a database Specify the data types, structures, and
constraints of the data to be stored
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
DB ConceptsDB Concepts
Meta-data Database definition or descriptive information Stored by the DBMS in the form of a database
catalog or dictionary
Manipulating a database Query and update the database miniworld Generate reports
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
DB ConceptsDB Concepts
Sharing a database Allow multiple users and programs to access
the database simultaneously
Application program Accesses database by sending queries to
DBMS
Query Causes some data to be retrieved As select the employee no with salary > 2000
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
DB ConceptsDB Concepts
Transaction May cause some data to be read and some
data to be written into the database.
Protection includes: System protection Security protection
Maintain the database system Process to monitoring and maintaining the
system following installation.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
و ذكـ�رو ذكـ�رل!ى الل!ه ع�ل�ي�ه� �ض�ي� الل!ه ع�ن�ه عن النبي ص � عن أبي هريرة ر
ل!م قال: �و�س
)إن الله تعالى يغار، وغيرة الله أن يأتي المرء ما حرم
الل!ه عليه(قG ع�ل�ي�ه�. �ت!ف م
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Chapter 1
Databases and
Database Users
Hour 2Presented & Modified by
Mahmoud Rafeek AlfarraLecturer in CST Kanyounis
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Hour 2 OutlineHour 2 Outline
Simplified database system environment. An introduction example about Database Phases for designing a database Data Abstraction
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
OracleMySqlAccess
As the CST’s System
As Student, DeanTeacher …
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
An introduction exampleAn introduction example
UNIVERSITY database Information concerning students, courses, and
grades in a university environment
Data records STUDENT COURSE SECTION GRADE_REPORT PREREQUISITE
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
An introduction exampleAn introduction example
Specify structure of Entity by specifying data type for each data element (attribute) as:
Student: Name is String of alphabetic characters ID: Integer Etc.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
An introduction exampleAn introduction example
Construct UNIVERSITY database Store data to represent each student, course,
section, grade report, and prerequisite as a record in appropriate file
Record is a row in table
Relationships among the records Manipulation involves querying and
updating
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
An introduction exampleAn introduction example
Examples of queries: Retrieve the transcript List the names of students who took the
section of the ‘Database’ course offered in fall 2008 and their grades in that section more than 80
List the prerequisites of the ‘Database’ course
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
An introduction exampleAn introduction example
Examples of updates: Change the class of ‘Ali’ to number 2 Create a new section for the ‘Database’ course
for this semester Enter a grade ‘A’ for ‘Ahmad’ in the ‘Database’
course of last semester
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Phases for designing a databasePhases for designing a database
Different people have different
views of the database…these are the external
schema
The internal schema is the
underlying design and
implementation
Conceptual design
Logical & Physical design
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Phases for designing a databasePhases for designing a database
Requirements specification and analysis Conceptual design:
To build the conceptual representation of the database, which includes identification of important entity and relationship (what?).
Conceptual representation of data does not include details of how data is stored or how operations are implemented.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Phases for designing a databasePhases for designing a database
Logical design : To translate the conceptual representation to
the logical structure of the database, which includes designing the relations.
Physical design To allow the designer to decide how the logical
structure is to be physically implemented on the target DBMS (How?).
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Data abstraction Allows program-data independence and
program-operation independence. Data abstraction is that we can change the
internal definition of an object without affecting the users of the object, provided the external definition remains the same.
Data AbstractionData Abstraction
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Data model Type of data abstraction used to provide
conceptual representation. An integrated collection of concepts for
describing data, relationships between data, and constrains on the data in an organization.
Data AbstractionData Abstraction
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
و ذكـ�رو ذكـ�رعن أبي موسـى األشـعري رضـي اللـه عنـه، قـال: ســمـعت رـســول اـلـلــه صــلـىـ الـلــهـ علـيــه وســلـم
يقول:
ه والـذي ال )) ه والـذي ال مثـل الـذي يـذكر ربـ! مثـل الـذي يـذكر ربـ!((يذ�ك ر ربـه مثل الحـي واـلميت يذ�ك ر ربـه مثل الحـي واـلميت
رواه البخاري
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Chapter 1
Databases and
Database Users
Hour 3Presented & Modified by
Mahmoud Rafeek AlfarraLecturer in CST Kan younis
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Hour 3 OutlineHour 3 Outline
Support of Multiple Views of the Data Sharing of Data and MTP Actors on the Scene
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Support of Multiple Views of the DataSupport of Multiple Views of the Data
View Subset of the database Contains virtual data derived from the
database files but is not explicitly stored
Multiuser DBMS Users have a variety of distinct applications Must provide facilities for defining multiple
views
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Sharing of Data and Multiuser Sharing of Data and Multiuser Transaction ProcessingTransaction Processing
Allow multiple users to access the database at the same time
Concurrency control software Ensure that several users trying to update the
same data do so in a controlled manner • Result of the updates is correct
Online transaction processing (OLTP) application
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Sharing of Data and Multiuser Sharing of Data and Multiuser Transaction ProcessingTransaction Processing
Transaction Central to many database applications Executing program or process that includes
one or more database operations Isolation property
• Each transaction appears to execute in isolation from other transactions
Atomicity property • Either all the database operations in a transaction
are executed or none are
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Actors on the SceneActors on the Scene
Database administrators (DBA) are responsible for: Authorizing access to the database Coordinating and monitoring its use Acquiring software and hardware resources
Database designers are responsible for: Identifying the data to be stored Choosing appropriate structures to represent
and store this data
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Actors on the SceneActors on the Scene
End users People whose jobs require access to the
database Types
• Casual end users• Naive or parametric end users• Sophisticated end users• Standalone users
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Actors on the SceneActors on the Scene
System analysts Determine requirements of end users
Application programmers Implement these specifications as programs
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
و ذكـ�رو ذكـ�رعن أبي هريـرة رضـي اللـه عنـه، قـال: سـمعت رسـول اللـه
صلى الله عليه وسلم يقول:
مــا جلس قــوم مجلســا لم يـذكروا اللـه )
فـيــه ولـم يصــلوا ـعـلى نــبيهـم إـال كــان
عـليهمـ تـرةـ فـإنـ شـاء عـذبهمـ وإن ـشـاء
رواه الترمذي (ـغـفر لـهم
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Chapter 1
Databases and
Database Users
Hour 4Presented & Modified by
Mahmoud Rafeek AlfarraLecturer in CST Kan younis
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Hour 4 OutlineHour 4 Outline
Workers behind the Scene Advantages of Using the DBMS Approach When Not to Use a DBMS Summary
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Workers behind the SceneWorkers behind the Scene
DBMS system designers and implementers Design and implement the DBMS modules and
interfaces as a software package
Operators and maintenance personnel Responsible for running and maintenance of
hardware and software environment for database system.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Controlling redundancy Data normalization
• Sometimes necessary to use controlled redundancy to improve the performance of queries
Restricting unauthorized access Security and authorization subsystem Privileged software
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Providing persistent storage for program objects Complex object in C# can be stored
permanently in an object-oriented DBMS Impedance mismatch problem
• Object-oriented database systems typically offer data structure compatibility
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Providing storage structures and search techniques for efficient query processing Indexes Buffering and caching Query processing and optimization
Case Study: What I is the main difference between Buffering and caching?
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Providing backup and recovery Backup and recovery subsystem of the
DBMS is responsible for recovery
Providing multiple user interfaces Graphical user interfaces (GUIs)
Representing complex relationships among data
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Enforcing integrity constraints Referential integrity constraint
• Every section record must be related to a course record
Key or uniqueness constraint• Every course record must have a unique value for
Course_number
Business rules Inherent rules of the data model
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Permitting inferencing and actions using rules Deductive database systems
• Provide capabilities for defining deduction rules• Inferencing new information from the stored
database facts
Trigger • Rule activated by updates to the table
Stored procedures• More involved procedures to enforce rules
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Advantages of Using the Advantages of Using the DBMS ApproachDBMS Approach
Additional implications of using the database approach Reduced application development time Flexibility Availability of up-to-date information Economies of scale
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
When Not to Use a DBMSWhen Not to Use a DBMS
More desirable to use regular files for: Simple, well-defined database applications not
expected to change at all Stringent, real-time requirements that may not
be met because of DBMS overhead Embedded systems with limited storage
capacity No multiple-user access to data
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
Summary
Database Collection of related data (recorded facts)
DBMS Generalized software package for
implementing and maintaining a computerized database
Several categories of database users Database applications have evolved
Current trends: IR, Web
Copyright © 2011 Ramez Elmasri and Shamkant Navathe modified by Mahmoud Rafeek Alfarra, March 2011
ذكـ�ر ووسلم ( عليه الله صلى 3ه2 الل س4ول4 ر7 7ل4 ق7ال7 م7ث
7ل2 7م7ث ك وAء2 الس3 الج7ليس و 2ح الص3ال الجليس Aم2ن 7عAد7م4ك7 ي 7 ال Aح7د3اد2، ال 2ير2 و7ك ، Aم2سAك2 ال ص7اح2ب2ر2يح7ه4، 7ج2د4 ت Aو
7 أ 7ر2يه2، ت A7ش ت 2م3ا إ ك2 Aم2سA ال ص7اح2ب2Aه4 م2ن 7ج2د4 ت Aو
7 أ 7ك7 7وAب ث Aو7 أ 7ك7 7د7ن ب 4حAر2ق4 ي Aح7د3اد2 ال 2ير4 و7ك
7ة[ 2يث ب خ7 ] )ر2يحا
البخاري رواه