Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.

Similar presentations


Presentation on theme: "1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process."— Presentation transcript:

1 1 Chapter 1 Introduction

2 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process of defining, constructing, and manipulating databases for various applications. n Definition A database is a collection of related data. n Definition Data are known facts that can be recorded and that have implicit meaning. n Definition File processing systems are business computer systems which store groups of records in separate files & used to process business records & produce information.

3 3 Introduction DBMS File Processing Systems - Data redundancy & inconsistency Reduced by ensuring a physical piece of data is available to all programs Data is often duplicated causing higher storage and access cost, poor data integrity, and data inconsistency - Accessing dataAllow flexible access to data (e.g., using queries for data retrievals) Allow pre-determined access to data (i.e., complied programs); application programs are dependent on file formats - Concurrent accessDesigned to coordinate multiple users accessing the same data at the same time Designed to allow a file to be accessed by two programs concurrently only if both programs have read-only access to the file - Data security & integrity High, enforced Loose, not enforced

4 4 Data Abstraction n Provides an abstract view of data n Physical level: the lowest level of abstraction describes the storage structure of data. n Conceptual level: the next-higher level of abstraction describes the logical structure of the database. n View level: the highest level of abstraction describes part of the entire database. Many views are provides for the same database.

5 5 Database Terminology n Database Schema or Conceptual View: describes the overall logical structure of the entire database n Database Instance: describes the content of the database n Schema = Type, Instance = Value of a variable

6 6 Data Independence n The capacity to change the schema definition at one level without having to change the schema definition at the next higher level  Physical data independence: capacity to change the physical schema without having to rewrite the application programs  Logical data independence: capacity to change the conceptual schema without having to rewrite the application programs  logical data independence is more difficult to achieve than physical data independence

7 7 Data Models n Describe relationships among data, data semantics, integrity, and semantic constraints at the conceptual and view levels n I. Object-Based Logic Models  DB is structured in variable-length records  Provide flexible structuring capabilities  Allow explicit specifications of data constraints  Widely used data models: Entity-Relationship and Object-Oriented n II. Record-Based Logical Models  DB is structured in fixed-format records of different types  Three widely used data models: Relational, Hierarchical, and Network n II. Semi-Structured Data Model  Data items of the same type can have different sets of attributes  Widely used data model: XML (Extensible Markup Language)

8 8 Entity-Relationship (E-R) Model n An object-based Model n A graphical structure (Chapter 7) n Widely used in database design n Consists of real world objects called entities and relationships among entities n An entity is an distinguishable object with a set of attributes n Entity set is a set of entities of the same type n Relationship set is a set of relationships of the same type n Mapping cardinalities represent the associations among different entities

9 9 An Entity-Relationship Diagram FACULTY STUDENT ID# FNAME DEPT ADDR SNAME HAS_TAKEN MAJOR ADVISES COURSE IS_TAKING COURSE#CRHRS 1 n n n mm An Entity Attribute A (Binary) Relationship Mapping Cardinalities Key Attribute

10 10 An Entity-Relationship Diagram FACULTY STUDENT ID# FNAME DEPT ADDR SNAME HAS_TAKEN MAJOR ADVISES COURSE IS_TAKING COURSE#CRHRS

11 11 n An object-based Model  Object identity (object-based) vs. value identity (record-based) n A collection of objects with unique identities  Objects can be simple, complex, or made up of other objects n Objects contain methods, i.e., codes operated on objects  An operation/function can be performed on objects of particular classes  Provide “public interface” for objects of a particular class n Classes consist of objects  Correspond to abstract data type (ADT)  Users can define their own classes  Only way to operate on an object by means of operators defined n Message passing for accessing data in different objects  Apply a given method to a given object by sending a message The Object-Oriented Model

12 12 Object-Oriented Database Systems city street stNumber Salary Address SSNo EmpName Employee PersonName String Ray String Ross SmallInteger 11122333 HomeAddress SmallInteger 1055 String SmallInteger Alameda Gresham 45558 first last Figure. An employee object.

13 13 The Relational Model n A record-based Model n Data are organized and stored into 2-dimensional tables (called relations) n Flexible to use and easy to understand n A relational database schema consists of a number of relation schemas of the form R(A 1, A 2, …, A n ), where R is a relation name and A i, 1 < i < n, is an attribute name.

14 14 The Relational Model Relational term Informal equivalence Relation Tuple Cardinality Attribute Degree Domain Primary Key Table Row/Record # of rows Column/Field # of columns Set of legal values Unique Identifier

15 15 The Relational Database Model SNAMESTATUSCITY S1Smith20 10 30 20 30 Jones Blake Clark Adams London Paris London Athens S2 S3 S4 S5 Supplier# Supplier London Paris etc. Supplier#NAME STATUSCITY Primary Key CardinalityCardinality Degree Relation Tuples Attributes Domains

16 16 Data Definition Languages (DDL) & Data Manipulation Languages (DML) n DDL  Declares the DB schema and compiles the schema into tables n DML  Access/Manipulate (retrieve, insert, delete, & modify) the DB Procedural (or descriptive): specify what is needed and how to get it Non-procedural (or declarative): specify what is needed but not how to get it

17 17 Overall System Structure


Download ppt "1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process."

Similar presentations


Ads by Google