SCHEMAS AND STATE OF THE DATABASE



Similar documents
Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

Data Modelling and E-R Diagrams

Database Management Systems

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

Database Design Process

How To Write A Diagram

Database Design Process

DATABASE SYSTEM CONCEPTS AND ARCHITECTURE CHAPTER 2

Designing a Database Schema

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

Entity Relationship Diagram

Relational Database Concepts

Foundations of Information Management

Lesson 8: Introduction to Databases E-R Data Modeling

Databases What the Specification Says

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

BCS Certificate in Data Management Essentials

2. Conceptual Modeling using the Entity-Relationship Model

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Documentation techniques and databases

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

Chapter 2 Database System Concepts and Architecture

Unit 5: Object-Role Modeling (ORM)

Data Modeling Basics

Data Analysis 1. SET08104 Database Systems. Napier University

Concepts of Database Management Seventh Edition. Chapter 6 Database Design 2: Design Method

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

Overview. Physical Database Design. Modern Database Management McFadden/Hoffer Chapter 7. Database Management Systems Ramakrishnan Chapter 16

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

G Barnaby Electronics Ltd case Study - Comparison of Entity-Relationship and Normalisation Database Designs

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Lecture 12: Entity Relationship Modelling

COMHAIRLE NÁISIÚNTA NA NATIONAL COUNCIL FOR VOCATIONAL AWARDS PILOT. Consultative Draft Module Descriptor. Relational Database

Foundations of Business Intelligence: Databases and Information Management

DATABASE INTRODUCTION

EXTENDED LEARNING MODULE A

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design

Information Management

The Entity-Relationship Model

An analysis of structural validity in entity-relationship modeling

Entity-Relationship Model

Chapter 2: Entity-Relationship Model. E-R R Diagrams

Foundations of Information Management

7.1 The Information system

THE OPEN UNIVERSITY OF TANZANIA FACULTY OF SCIENCE TECHNOLOGY AND ENVIRONMENTAL STUDIES BACHELOR OF SIENCE IN DATA MANAGEMENT

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

ECS 165A: Introduction to Database Systems

The Entity-Relationship Model

n Assignment 4 n Due Thursday 2/19 n Business paper draft n Due Tuesday 2/24 n Database Assignment 2 posted n Due Thursday 2/26

IV. The (Extended) Entity-Relationship Model

Databases and Information Management

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Database Concepts. Database & Database Management System. Application examples. Application examples

AS LEVEL Computer Application Databases

OVERVIEW 1.1 DATABASE MANAGEMENT SYSTEM (DBMS) DEFINITION:-

XV. The Entity-Relationship Model

Doing database design with MySQL

Chapter 2. Data Model. Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel

THE OPEN UNIVERSITY OF TANZANIA FACULTY OF SCIENCE TECHNOLOGY AND ENVIRONMENTAL STUDIES BACHELOR OF SIENCE IN INFORMATION AND COMMUNICATION TECHNOLOGY

14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Information Systems Analysis and Design CSC John Mylopoulos Database Design Information Systems Analysis and Design CSC340

CHAPTER 6 DATABASE MANAGEMENT SYSTEMS. Learning Objectives

Database Fundamentals: 1

Module Contact: Dr. Beatriz de la Iglesia, CMP Copyright of the University of East Anglia Version 1

Entity - Relationship Modelling

COURSE NAME: Database Management. TOPIC: Database Design LECTURE 3. The Database System Life Cycle (DBLC) The database life cycle contains six phases;

Introduction to normalization. Introduction to normalization

Database Design Methodology

The Entity-Relationship Model

Chapter 2: Entity-Relationship Model

AVOIDANCE OF CYCLICAL REFERENCE OF FOREIGN KEYS IN DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL

Answers to Review Questions

Controlling Data Resources in Distributed Environments Barbara Grant

Chapter 1: Introduction. Database Management System (DBMS)

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project?

DATA MODELING AND RELATIONAL DATABASE DESIGN IN ARCHAEOLOGY

Exercise 1: Relational Model

BİL 354 Veritabanı Sistemleri. Entity-Relationship Model

ER modelling, Weak Entities, Class Hierarchies, Aggregation

TIM 50 - Business Information Systems

Database System Concepts

Chapter 1: Introduction. Database Management System (DBMS) University Database Example

Student Attendance Through Mobile Devices

Fundamentals of Information Systems, Fifth Edition. Chapter 8 Systems Development

Chapter 10. Practical Database Design Methodology. The Role of Information Systems in Organizations. Practical Database Design Methodology

æ A collection of interrelated and persistent data èusually referred to as the database èdbèè.

Release: 1. ICADBS502A Design a database

Chapter 6 FOUNDATIONS OF BUSINESS INTELLIGENCE: DATABASES AND INFORMATION MANAGEMENT Learning Objectives

ISM 318: Database Systems. Objectives. Database. Dr. Hamid R. Nemati

Chapter 1: Introduction

Fundamentals of Database Design

Foundations of Business Intelligence: Databases and Information Management

DATABASE MANAGEMENT SYSTEM

CSC 742 Database Management Systems

Transcription:

SCHEMAS AND STATE OF THE DATABASE Schema the description of a database specified during database design relatively stable over time Database state the data in a database at a particular moment the set of occurrences or instances DataBase Management 29

DATABASE SYSTEM ARCHITECTURE Main characteristics of the database approach are: i. Provision of data and program independence ii. support of multiple user views iii. use of a catalogue to store the database description. This is achieved by the Three-Schema Architecture. Internal (physical) level o Describes physical storage structure of database Conceptual and logical levels o Describes the structure of the whole database - describing entities, data types, relationships, user operations and constraints with no concern of the physical storage details External (view) level o Describes the part of the database that a particular user group is interested in and hides the rest of the database from that user group. DataBase Management 30

DATABASE SYSTEM ARCHITECTURE The Three-Schema Architecture External view 1 External/conceptual mapping END USERS External view 2 Conceptual/internal mapping Conceptual Schema Internal Schema STORED DATABASE DataBase Management 31

DATABASE SYSTEMS DESIGN AND IMPLEMENTATION USER REQUIREMENTS ENGLISH DESCRIPTION CONCEPTUAL DESIGN ER MODEL LOGICAL DESIGN DATA MODEL PHYSICAL DESIGN FILE ANS INDEX DESIGN IMPLEMENTATION TARGET DBMS SELECTION TESTING & INSTALLATION DataBase Management 32

CONCEPTUAL DESIGN Input: requirements specification Output: conceptual schema Conceptual schema is a high level description of the structure of the database, independent of the particular DBMS software. A conceptual model is a language that is used to describe conceptual schemas. The purpose of conceptual design is to describe the information content of the database rather than the storage structures. DataBase Management 33

LOGICAL DESIGN Input: conceptual schema Output: logical schema Logical schema is a description of the structure of the database that can be processed by the DBMS software. A logical model is a language that is used to specify logical schemas. Logical design depends on the class of data model used by the DBMS, but not on the specific DBMS used. Logical Models o Relational Model o Network Model o Hierarchical Model o Object-oriented DataBase Management 34

PHYSICAL DESIGN Input: logical schema Output: physical schema A physical schema is a description of the implementation of the database in secondary memory. It describes the storage structures and access methods used in the system. There is feedback between physical and logical design, because decisions taken during physical design for improving performance might affect the structure of the logical schema. Once the physical database design is completed, the logical and physical schemas are expressed using the data definition language of the target DBMS. The database is created and populated, and can be tested. DataBase Management 35

DATA MODELING In designing a database for an enterprise, initially one has to identify and state what data needs to be stored the data requirements. Example: Stock control application- Each stock item has a stock number, a description, price, quantity in stock, reorder level and supplier Each item has only one supplier From this statement of data requirements a conceptual data model is produced. OPERATIONAL DATA = ENTITIES + RELATIONSHIPS E.g. suppliers E.g. suppliers supplies a certain kind of part hence link between supplier and part entities DataBase Management 36

THE CONCEPTUAL DATA MODEL A conceptual data model describes how the data elements in the system are to be grouped. Three terms are used in building a picture of the data requirements. An entity is a thing of interest to an organization about which data is to be stored. - Example: stock, supplier, An attribute is a property or characteristic of an entity. - Example: stock item description A relationship is a link or association between entities.- Example: link between stock items and suppliers: - one supplier may supply many stock items This conceptual/logical model is created without any regard to what type of database system will eventually be used to implement it. Example: the entity stock and its attributes are expressed as follows: STOCK(part_number, description, price, quantity, reorder level, supplier) DataBase Management 37

TYPES OF RELATIONSHIPS Each relationship has a name (e.g. supplies) and the cardinality, which may be any of: one-to-one one-to-many (or many-to-one) many-to-many Example :- the relationship between supplier and stock: Name : supplies (as indicated) Cardinality: one-to-many (a supplier supplies many stock items) DataBase Management 38

OTHER EXAMPLES E.g. 1: One-to-one: a specialist is assigned to a single ward (Given that a specialist has one ward of patients under his care) E.g. 2: One-to-many: a hospital ward occupied by many patients (but a patient is assigned to only one ward). E.g. 3: Many-to-many: a student may study several courses, each course has many students enrolled on it. Exercise: Identify the relationship between these entities: stock item and supplier CD and song Borrower and book Brother and Sister Bank Account and Customer DataBase Management 39

ENTITY-RELATIONSHIP DIAGRAMS (E-R DIAGRAMS) An entity-relationship diagram is a diagrammatic way of representing the relationships between the entities in a database. To show the relationship between two entities, both the cardinality and the name of the relationship need to be specified. An E-R diagram illustrates the entities and their relationships for a specific system. visits SPECIALIST WARD accommodates WARD PATIENTS enrolls STUDENT COURSE DataBase Management 40

EXAMPLE 1 The data requirements for a hospital in-patient system are defined as follows: A hospital is organized into a number of wards. Each ward has a ward number and a name recorded, along with a number of beds in that ward. Each ward is staffed by nurses. Nurses have their staff number and name recorded, and are assigned to a single ward. Each patient in the hospital has a patient identification number, and their name, address and date of birth are recorded. Each patient is under the care of a single consultant and is assigned to a single ward. Each consultant is responsible for a number of patients. Consultants have their staff number, name and specialization recorded (Adapted from Heathcote). 1. State four entities for the hospital in-patient system and suggest an identifier for each of these entities. 2. Draw an entity-relationship diagram to show the relationship between the entities. DataBase Management 41

SOLUTION ENTITY Ward Nurse Patient Consultant Instance identification Ward Number Staff Number Patient Identification Number Staff Number WARD is assigned NURSE accommodates PATIENT visits CONSULTANT DataBase Management 42

EXAMPLE 2 In a mail order system, a customer may place an order for several items. Over a period of time, the same customer may place several orders. Entities: Customer, Item, Order Drawing an E-R diagram to represent this situation: CUSTOMER ORDER ORDER ITEM relationship pairs CUSTOMER sends ORDER is for ITEM DataBase Management 43

Solution An alternative data model decomposing the many-to-many relationship between order and items: CUSTOMER sends ORDER includes ITEM ORD_ITEM matches An order includes a number of ordered items. A particular item may be ordered in different orders (hence matches 0, 1 or many ordered item records). DataBase Management 44

Exercise The data requirements for a booking system are defined as follows: An agency arranges booking of live bands for a number of clubs. Each band is registered with the agency and has its name (unique) recorded, together with the number of musicians, the type of music played and hiring fee. Each band is managed by a manager. A manager may manage several bands. Each manager is assigned an identification number and managers have their name, address and telephone number recorded. Each club is assigned an identification number and clubs have their name, address and telephone number recorded. The agency records details of each booking made between a band and a club for a given date. A band will never have more than one booking on any particular date. 1. State four entities for this booking system and suggest an identifier for each of these entities. 2. Draw an entity-relationship diagram to show the relationship between the entities. DataBase Management 45