1 / 37

Introduction to Database Concepts and Applications

This chapter covers the fundamental concepts of databases, including the difference between data and information, the role of a database management system (DBMS), and the limitations of file-based systems. It also explains the characteristics and disadvantages of database systems, as well as the languages used in database management systems (DDL and DML).

Télécharger la présentation

Introduction to Database Concepts and Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 Database Concepts Chapter 1 & 2 in Textbook

  2. Database Concepts Data is a meaningless static value. e.g. Ali, 3421. What does 3421 means? Information is the data you process in a manner that makes it meaningful. Information can be provided only if proper data exists. e.g. “Ali ID number is 0987”. A database (DB) is a collection of a logically related persistent data, designed to meet the information needs of an organization. Can be generated & maintained manually or automatically. Data is what you store in database. Information is what you retrieve from a database.

  3. Database Concepts A database application is a collection of data and the programs that allow the manipulation of these data to meet the information needs of an enterprise. Database Management System (DBMS): A software system that facilitates the creation and maintenance of a database, i.e. implementing database application. Application Program (of a Database): a computer program that interacts with database by issuing an appropriate request (SQL statement) to the DBMS. Database System (DBS): is database and Software (DBMS + Application Program).

  4. DBS Environment Users/Programmers DBS Application Programs DBMS Query Process Data Access Meta-Data Database

  5. Examples of Database Applications • Edugate and ERegister. • KSU Library. • Supermarket system. • Credit card system. • Saudi Airlines Reservations.

  6. File-Based Systems (FBS) FBS is a collection of application programs that perform tasks (e.g. reports) where each program defines and manages its own data. File handling Data Entry & Reports User 1 (Sales) File Def Sales Application Program Sales File File handling Data Entry & Reports User 2 (HR) File Def HR Application Program HR File

  7. File-Based Systems (FBS) Major limitations of FBS: • Data Redundancy and Inconsistency. • Data isolation and separation. • Data dependence. • Incompatible file formats. • Fixed Queries/Proliferation of application programs.

  8. File-Based Systems (FBS) These limitations of the FBS approach attributed to two factors: • The definition of data is embedded in the application programs, rather than being stored separately and independently. • There is no control over the access & manipulation of data beyond the imposed by the application program.

  9. Database Systems (DBS) DBS is a single large repository of data, defined once and managed using DBMS while used by many application programs. DBS Data Entry & Reports User 1 (Sales) Sales Application Program DBMS Data Entry & Reports Database User 2 (HR) HR Application Program

  10. Database Systems (DBS) Major characteristics of DBS: • Self-describing nature of a database system. • Program-data independence. • Sharing of data and multi-user transactions processing (guarantee Concurrency Control). • Support of multiple views of the data.

  11. Database Systems (DBS) Disadvantages of DBS: • Complexity. • Size. • Cost (DBMS, Hardware, Staff, Training). • Performance. • Higher impact of a failure.

  12. Database Management System (DBMS) A DBMS is a collection of software thatfacilitates the implementation andmanagement of database applications. DBMS facilitates the following: • Create and Define a DB. • Construct and Load a DB contents. • Manipulate a DB (query & update the DB). • Control access to data.

  13. Database Management System (DBMS) Major Relational DBMS vendors/products: • Paradox/Corel. • dBase/Clipper. • FoxPro, Access & SQL Server/MS. • MySQL. • DB2/IBM. • Oracle, Sybase, Informix.

  14. DBMS Languages • Data Definition Language (DDL): • DDL is a descriptive language for defining and constructing the database. • Allows users to specify the data types and structures and the constraints on the data to be stored in the DB. • DDL compiler generates the meta-data that is stored in the data dictionary.

  15. DBMS Languages • Data Manipulation Language (DML): • DML is a language for retrieving and updating (insert, delete, & modify) the data in the DB. • Types of DML: – Low level or Procedural Language: user specifies what data is required and how to get those data. – High level or Nonprocedural Language: user specifies what data is required without specifying how to get those data.

  16. DBMS Languages Both DDL and DML are usually not considered distinct languages. Rather, they are included in a comprehensive integrated language. For example, SQL relational database language is a comprehensive DB language which represents a combination of DDL and DML.

  17. DBMS Languages DBMS have a facility for embedding DDL & DML (sub-languages) in a High-Level Language (COBOL, C, C++ or Java), which in this case is considered a host language. C,C++,Lisp,.. Application Program Call to DB DBMS Local Vars (memory)

  18. Roles in the Database Environment Communicate Procedure User Requirement Write Write DB Designer System Analyst Application programmer Design DBA Program Manage App Program DBMS Use Naïve End User DB Use H/W Sophisticated End User

  19. Roles in the Database Environment System Analyst: Determine the user requirements and develop the system specifications. Database Designer: Identify the data and choose the appropriate structure to represent and store the data. Application Programmer: Implement the application program based on the system specification. Database administrator (DBA): Administrates the DB, DBMS and related software.

  20. Roles in the Database Environment Database End-users: They use the data for queries, reports and some of them update the database content (data). End-users can be categorized into: • Naïve users: Invokes one of the permanent application programs that have been written previously. • Sophisticated users: form requests in a database query language. Additional Roles: • DBMS designer and implementer. • Tool Developer. • Operators and maintenance Personnel.

  21. Schemas versus Instances Database Schema: The description of the database. It rarely changes. • Includes descriptions of the database structure, data types, and the constraints on the database. Database Instance (snapshot): The actual data stored in a database at a particular moment in time. Changes rapidly. The concepts of Schema & Instances corresponds to Types & Values in programming languages, respectively.

  22. Example Schema Instance

  23. Three-Schema Architecture User 1 User 2 User n External Level View 1 View 2 View n Conceptual Level Conceptual Schema Internal Level Internal Schema DB

  24. Three-Schema Architecture Defines DBMS schemas at three levels: • External Level • Describes that part of database that is relevant to a particular user. • Users’ view of the database. The way perceived by end users. • Conceptual Level • Describes what data is stored in database and relationships among the data. • The way perceived by the DBA & programmers. • Internal Level • Describes how the data is stored in the database. • The way perceived by the DBMS & OS.

  25. Three-Schema Architecture External Level View 1 View 2 Staff_No FName LName Age Salary Staff_No LName Bno Conceptual Level Staff_No FName LName DOB Salary Bno Struct STAFF { int Staff_No; char FName [15]; char LName [15]; date DOB; float Salary; int Bno; struct STAFF * next; }; Internal Level

  26. Three-Schema Architecture Proposed to support DBMS characteristics of: • Program-data independence. • Support of multiple views of the data.

  27. Mapping • Mapping is the process of transforming requests and results between the Internal, Conceptual & External levels. • Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution. • Data extracted from the internal DBMS level is reformatted to match the user’s external view. • Two types of mapping: • – External / Conceptual mapping. • – Conceptual / Internal mapping.

  28. Data Independence Data Independence is the ability to modify a schema definition in one level without affecting a schema definition in the next higher level. Two levels of data independence: – Logical data independence. – Physical data independence. Data Independent is similar to the concept of ADT in programming language where both hide the implementation details from the user.

  29. Data Independence in Three-Schema Architecture External Schema External Schema External Schema External/Conceptual Mapping Logical data Independence Conceptual Schema Conceptual/Internal Mapping Physical data Independence Internal Schema

  30. Data Models Data Model: A set of concepts to describe the structure of a database, the operations for manipulating these structures, and certain constraints that the database should obey. Purpose of data modelling is to represent data in an understandable way. Categories of data models include: • Conceptual data models (Object-based). • Logical data models (Record-based). • Physical data models.

  31. Categories of Data Models Conceptual data models: is the construction of an enterprise’s information that is independent of implementation details. • Also called entity-based or object-based data models. Logical data models: is the logical description of an enterprise’s information with high level description of the implementation. • Also called record-based data models. Physical data models: is the physical description of how data is stored in the computer.

  32. Categories of Data Models Hardware independent Software independent Conceptual model Hardware independent Software dependent Logical model Hardware dependent Software dependent Physical model

  33. Data Models Conceptual Data Models (Object-Based): • Entity-Relationship. • Semantic. • Functional. • Object-Oriented. Logical Data Models (Record-Based): • Relational Data Model. • Network Data Model. • Hierarchical Data Model. Physical Data Models.

  34. Data Models Staff Branch Staff_No LName Salary Brn_No Brn_No Street Tel_No Relational Data Model St1 Name1 7000 1 1 Olayaa 4630000 2 Malaz 4780000 3 Rawda 2310000 St2 Name2 4000 1 St3 Name3 6500 2 St4 Name4 3000 3 St1 Name1 7000 Olayaa 4630000 Network DataModel Malaz 4780000 St2 Name2 4000 Rawda 2310000 St3 Name3 6500 St4 Name4 3000

  35. Data Models Malaz 4780000 Olayaa 4630000 Rawda 2310000 St4 Name4 3000 St3 Name3 6500 St1 Name1 7000 St2 Name2 4000 Hierarchical Data Model

  36. Summary of DB Concepts • Database (DB). • Database Application. • Database Management System (DBMS). • Database System (DBS) - Centralized approach. • File-Based System(FBS) - Decentralized approach. • Program-data dependence & independence. • Meta-data & data dictionary. • Concurrency Control. • Data Definition Language (DDL). • Data Manipulation Language (DML).

  37. Summary of DB Concepts • Schemas & Instances. • Three-schema Architecture (internal, conceptual, external levels). • Mapping (external/conceptual, conceptual/internal). • Data Independence (logical & physical). • Query language & host language. • Conceptual model, Logical model, & Physical model. • Data model (Entity-Relationship,Object-Oriented,Relational).

More Related