Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department.

Similar presentations


Presentation on theme: "Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department."— Presentation transcript:

1 Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department

2 Database & Database Management System  A database is a repository for collections of related data or facts.  A database management system (DBMS) is a collection of programs and tools to create & maintain a database.  DBMS: a software tool that lets users add, view, and work with the data in a database.

3 Why Use A Database?  The purpose of a database is to help people and organizations keep track of things.  Problems of using file systems to store data:  Data redundancy and inconsistency  Multiple file formats, duplication of information in different files  Difficulty in accessing data  Need to write a new program to carry out each new task  Data privacy: (Security problems)  Hard to provide user access to some, but not all, data

4  Integrity problems  Integrity constraints (e.g. account balance > 0)  Hard to add new constraints or change existing ones.  Concurrent access by multiple users  Concurrent accessed needed for performance  Uncontrolled concurrent accesses can lead to inconsistencies.  Database systems offer solutions to all the above problems

5  Fields, which store various pieces of data related to a single entity.  Records, or collections of fields relating to an entity.  Tables, which are collections of related records. A DBMS allows users to access and manage the data collected in a database. Databases use three main structures for organizing data:

6 Components of A Database System (1) (2)(3)(4)

7 1. Database Users:  Users : are differentiated by the way they expect to interact with the system  Application programmers : interact with system through DML calls  Sophisticated users : form requests in a database query language  Specialized users : write specialized database applications that do not fit into the traditional data processing framework

8 2. Database Application:  Functions:  Create and process forms  Create and transmit queries  Create and process reports  Execute application logic  Control application

9 3.Database Management System (DBMS):  DBMS contains information about a particular enterprise  Collection of interrelated data  Set of programs to access the data  An environment that is both convenient and efficient to use  Database Applications Examples:  Banking: all transactions  Airlines: reservations, schedules  Universities: registration, grades  Databases touch all aspects of our lives

10 DBMS Functions :  Create database, tables, and supporting structures  Read and update database data  Maintain database structures  Enforce rules  Control concurrency  Provide security  Perform backup and recovery  Example: Oracle, DB2, Microsoft Access, SQL Server

11 Data Management tasks:  All done through the DBMS can be divided into three categories:  Entering data into the database.  Sorting (rearranging) the data in the database.  Obtaining subsets of the data for use.

12 4. Database:  Database is a self-describing collection of related records or tables  Components:  User Data  Metadata: data about the structure of a database  Indexes and related structures  Stored procedures: program modules stored within the database  Triggers: a procedure that is executed when a particular data activity occurs  Application metadata: data describing application elements such as forms and reports

13 System Requirements  High Availability:  on-line => must be operational while enterprise is functioning  High Reliability:  correctly tracks state, does not lose data, controlled concurrency  High Throughput:  many users => many transactions/sec  Low Response Time:  on-line => users are waiting

14  Long Lifetime:  Complex systems are not easily replaced  Must be designed so they can be easily extended as the needs of the enterprise change.  Security:  Sensitive information must be carefully protected since system is accessible to many users.  Authentication, authorization, encryption

15 Working With a Database  Creating Database Tables  This means identifying, naming, and organizing its fields to receive data.  Viewing Records  A filter is a tool that lets you view records that match a given criterion.  Sorting Records  Sorting means arranging the records in a database  A DBMS enables you to sort records alphabetically, numerically, and chronologically.  Querying a Database  A query is a statement you define, which tells the DBMS to find records that match criteria you specify.  Generating Reports  A report is a subset of information from a database, produced in printed form.

16 Types of Database  Personal database  1 user; < 10 MB  Workgroup database  25 users; < 100 MB  Organizational database  Hundreds to thousands users  >1 Trillion bytes, possibly several databases

17 Database Architecture An architecture for a database system

18  Physical level:  describes how a record is stored.  Logical level:  describes data stored in database, and the relationships among the data.  View level:  Application programs hide details of data types. Views can also hide information for security purposes.

19 Database Design The process of designing the general structure of the database: Logical Design – Deciding on the database schema. Schema – the logical structure of the database. –Physical schema: database design at the physical level –Logical schema: database design at the logical level Physical Design – Deciding on the physical layout of the database

20 Building a Database System For building a database, Some questions must have answer:  How many records we will warehouse and for how long?  Who will be using the database and what tasks will they perform?  How often will the data be modified? Who will make these modifications?  What hardware is available? Is there a budget for purchasing additional hardware?  Who will be responsible for maintaining the data?  Will data access be offered over the Internet? If so, what level of access should be supported?

21 Building a Database System:  Requirements phase: A data model is developed  Data model is a logical representation of the database structure.  Design phase: The data model is transformed into tables and relationships  Implementation phase:  Tables, relationships, and constraints are created  Stored procedures and triggers are written  The database is filled and systems are tested  Database and its applications will be modified (through these same three phases) to meet new requirements.

22 Data Model: What’s a model?  A data model is a representation of reality.  A collection of tools for describing:  Data  Data relationships  Data semantics  Data constraints  It’s used to define the storage and manipulation of a data base.  Data Models have two components:  Structure: the structure of the data stored within.  Operations: Facilities for manipulation of the data.

23 Relational Database  Definition:  Data stored in tables that are associated by shared attributes (keys).  Any data element (or entity) can be found in the database through the name of:  The table,  The attribute, and  The value of the primary key.

24 Keys  A key is a set of attributes for one entity set such that no two entities in this set agree on all the attributes of the key.  It is allowed for two entities to agree on some, but not all, of the key attributes.  We must designate a key for every entity set.

25 Database Keys  Primary Key :  Indicates uniqueness within records or rows in a table.  Foreign Key :  The primary key from another table,  This is the only way join relationships can be established.  There may also be alternate or secondary keys within a table.

26 Relational Database Definitions  Entity:  Object, Concept or event (subject)  Attribute:  A Characteristic of an entity  Row or Record:  The specific characteristics of one entity  Table:  A collection of records  Database:  A collection of tables

27 Entity, Attribute, Relationship Client Name Address Postcode Passport Passport No Exp.Data Itinerary Date City Contact Entity Attribute Relationship

28 The Relational Model Characteristics:  Each attribute has a unique name within an entity.  Attributes are characteristics of an entity.  All entries in the column are examples of it.  Each row is unique.  Tables represent entities.  Tables are always named in the singular.  Ordering of rows and columns is unimportant.  Each position (tuple) is limited to a single entry.

29 Basic relationships  One-to-One  One-to-many  Many to many StudentStud_IDStudentCourse Class Student

30 CRUD ! Refers to the most common Database Operations: –Create –Read –Update –Delete Operations occur at all levels: Tables, Records, Columns

31 Database Views  A View is an individual’s picture of a database.  It can be composed of many tables, unbeknownst to the user.  It’s a simplification of a complex data model.  It provides a measure of database security.  Views are useful, primarily for READ-only users and are not always safe for CREATE, UPDATE, and DELETE.

32 Data Manipulation Language (DML)  Language for accessing and manipulating the data organized by the appropriate data model  DML also known as query language  Two classes of languages  Procedural – user specifies what data is required and how to get those data  Declarative (nonprocedural) – user specifies what data is required without specifying how to get those data  SQL is the most widely used query language

33 Data Definition Language (DDL)  Specification notation for defining the database schema  Example:create table account ( account-number char(10), balance integer)  DDL compiler generates a set of tables stored in a data dictionary  Data dictionary contains metadata (i.e., data about data)  Database schema  Data storage and definition language  Integrity constraints

34 Data Dictionary (DD)  Data dictionary (or system catalog) is a data about the database.  A database contains information about entities of interest to users in an organization.  When created, the database itself becomes an “entity” about which information must be kept for various data administration purposes.  Contents of a DD are commonly referred to as metadata.  DD can be updated, queried much as a “regular” database.  DBMS often maintains the DD.

35 Rationale for a DD  Provides a summary of the structure of the database  Helps DBA manage the database.  Informs users of database scope.  Facilitates communication between users and database administrators.  Allows the DBMS to manage the creation, access, and modification of tables and their components.

36 Structure of a DD  DD can be integrated with the DBMS or stand-alone  Relational systems all have some form of integrated DD (e.g., Oracle)  Integrated DD is usually active, meaning it is automatically updated to reflect changes in the database.  A stand-alone DD is not directly linked to the database and must be updated manually.

37 Typical DD Contents  Data elements  names, data type  Tables  owner, creation date, access specifications, size  Indexes  name, attributes involved, creation date  Authorized users  names, type(s) of access  Integrity Constraints

38 Storage Management  Storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system.  The storage manager is responsible to the following tasks:  Interaction with the file manager  Efficient storing, retrieving and updating of data  Issues:  Storage access  File organization  Indexing and hashing

39 Transaction Management  A transaction is a collection of operations that performs a single logical function in a database application  Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures.  Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database.

40 Database Architecture  The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running:  Centralized  Client-server  Parallel (multi-processor)  Distributed

41 History of Database Systems  1950s and early 1960s:  Data processing using magnetic tapes for storage  Tapes provide only sequential access  Punched cards for input  Late 1960s and 1970s:  Hard disks allow direct access to data  Network and hierarchical data models in widespread use  High-performance (for the era) transaction processing

42  1980s:  Research relational prototypes evolve into commercial systems  SQL becomes industrial standard  Parallel and distributed database systems  Object-oriented database systems  1990s:  Large decision support and data-mining applications  Large multi-terabyte data warehouses  Emergence of Web commerce  2000s:  XML and XQuery standards  Automated database administration

43 Recent History  Success story of the Microsoft Access  Microsoft Office suite and Windows integration  Easy-to-use and powerful personal DBMS  Internet database  XML and database integration

44 Questions? ?


Download ppt "Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department."

Similar presentations


Ads by Google