2 Conceptual Database Design 2.1 Requirement analysis 2.2 Modeling languages. Terminology. Requirements: Case study. Requirements



Similar documents
Requirement Analysis & Conceptual Database Design. Problem analysis Entity Relationship notation Integrity constraints Generalization

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

Logical Schema Design: The Relational Data Model

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

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

Databases and BigData

Database Design Methodology

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

2. Conceptual Modeling using the Entity-Relationship Model

IV. The (Extended) Entity-Relationship Model

Lecture 12: Entity Relationship Modelling

Relational Database Basics Review

7.1 The Information system

Data Analysis 1. SET08104 Database Systems. Napier University

Entity-Relationship Model

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

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

11 November

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

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

XV. The Entity-Relationship Model

The Entity-Relationship Model

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

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

Object Oriented Databases. OOAD Fall 2012 Arjun Gopalakrishna Bhavya Udayashankar

IT2305 Database Systems I (Compulsory)

Lesson 8: Introduction to Databases E-R Data Modeling

Chapter 3. Data Analysis and Diagramming

A Tool for Generating Relational Database Schema from EER Diagram

Relational Database Concepts

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

10.1 Introduction OLTP versus OLAP. 10 Data Warehouses in a nutshell. Analytical queries on OLTP DB. The naive Bookshop DB

IT2304: Database Systems 1 (DBS 1)

Umbrello UML Modeller Handbook

Doing database design with MySQL

A brief overview of developing a conceptual data model as the first step in creating a relational database.

Object-Based Databases

Data Modeling and Databases I - Introduction. Gustavo Alonso Systems Group Department of Computer Science ETH Zürich

Data Modeling Basics

Database Design Methodologies

Chapter 1: Introduction

Lecture Notes INFORMATION RESOURCES

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Designing Databases. Introduction

A terminology model approach for defining and managing statistical metadata

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

Fundamentals of Database Design

PUBLIC Supplement for J.D. Edwards

ECS 165A: Introduction to Database Systems

Database 2 Lecture I. Alessandro Artale

Foundations of Information Management

The Relational Data Model: Structure

Files. Files. Files. Files. Files. File Organisation. What s it all about? What s in a file?

Chapter 1: Introduction. Database Management System (DBMS)

Data Modeling with Entity-Relationship Diagrams

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

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

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


Information Management Metamodel

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model

Modern Databases. Database Systems Lecture 18 Natasha Alechina

Database Design Patterns. Winter Lecture 24

Business Database Systems

High-level Design. What is software architecture?

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen

A Tutorial on Quality Assurance of Data Models 1. QA of Data Models. Barry Williams. tutorial_qa_of_models.doc Page 1 of 17 31/12/ :18:36

Why Data Flow Diagrams?

The Information System Lifecircle

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #5: En-ty/Rela-onal Models- - - Part 1

Database Management Systems

CSE 132A. Database Systems Principles

DbSchema Tutorial with Introduction in SQL Databases

CA IDMS. Database Design Guide. Release , 2nd Edition

Requirements / Use Case Specification

A Project Presentation on Online Car Rental System

B.1 Database Design and Definition

Design and UML Class Diagrams

CDC UNIFIED PROCESS PRACTICES GUIDE

Relational Database Management LIS458

Domain Modeling. Domain Modeling

Generating Enterprise Applications from Models

4 Logical Design : RDM Schema Definition with SQL / DDL

Designing a Database Schema

Design and UML Class Diagrams. Suggested reading: Practical UML: A hands on introduction for developers

Introduction to database management systems

ER modelling, Weak Entities, Class Hierarchies, Aggregation

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Review Entity-Relationship Diagrams and the Relational Model. Data Models. Review. Why Study the Relational Model? Steps in Database Design

TECH. Requirements. Why are requirements important? The Requirements Process REQUIREMENTS ELICITATION AND ANALYSIS. Requirements vs.

Once the schema has been designed, it can be implemented in the RDBMS.

A Short Tutorial on Using Visio 2010 for Entity-Relationship Diagrams

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

Information Systems SQL. Nikolaj Popov

Transcription:

CREATE TABLE Studentin (SID INTEGER PRIMARY KEY, VName CHAR(20) Name CHAR(30) CREATE NOT NULL, TABLE Kurs Email Char(40)); (KID CHAR(10) PRIMARY KEY, Name CHAR(40) NOT NULL, Dauer INTEGER); 2 Conceptual 2.1 Requirement analysis 2.2 Modeling languages 2.1.1 Overview 2.1.2 Requirement Analysis (case study) 2.2.1 Basic Modeling Primitives 2.2.2 Modeling Languages: UML and Entity-Relationship Model (ERM) 2.2.3 Conceptual DB design: basics 2.2.4 From Requirements to Models 2.1.1. Overview Lifecycle Requirement analysis Conceptual Logical Schema Physical Schema -> Text -> Conceptual Model -> schema -> Access paths CREATE TABLE Order ODate DATE soldby INTEGER FOREIGN KEY REFEREBCES Peronal(PID) CID INTEGER FOREIGN KEY REFERENCES (CID)); References: Kemper / Eickler chap 2, Elmasri / Navathe chap. 3 Garcia-Molina / Ullmann / Widom: chap. 2 Administration HS / DBS05-2-Conceptual 2 : UML / ER model, entity definition Table, index, view Information Build Overview Hand-in-hand design of DB and intended applications Conceptual Data Modeling Business Requirements Cross-checking Cross-checking Operational System Process Function Modeling Build Module (screen, report, menu, SQL applications) HS / DBS05-2-Conceptual 3 : Terminology Process of defining the overall structure of a database on Different layers of abstraction Conceptual, logical, physical level Includes "Analysis" and "" from SE DB Modeling: defining the "Static model" using formal or visual languages DB Requirements Conceptual modeling Logical modeling Physical modeling SE Requirements Analysis Implementation HS / DBS05-2-Conceptual 4 2.1.2 Requirement Analysis Most important: communicate with your customers! Tasks during RA: Identify essential "real world" information (e.g. interviews) Remove redundant, unimportant details Clarify unclear natural language statements Fill remaining gaps in discussions Distinguish data and operations Requirement analysis & Conceptual aims at focusing thoughts and discussions! HS / DBS05-2-Conceptual 5 Requirements: Case study I m the owner of a medium size video store. We have over 10.000 video tapes that we need to keep track of. Since a few month, we also have DVDs. Each of our video tapes has a tape number. For each movie, we need to know its and category (e.g. comedy, suspense, drama, action, or sci-fi). Yes, we do have multiple copies of many of our movies. We give each movie a specific id, and then track which movie a tape contains. A tape may be either Beta or VHS Format. We always have at least one tape for each movie we track, and each tape is always a copy of a single, specific movie. Our tapes are adapted to the movie lengths, so we don t have any movies which require multiple tapes. The movies are stored on shelf according to their category sorted by movie. We are frequently asked for movies starring specific actors John Wayne and Katherine Hepburn are always popular. So we d like to keep track of the star actors appearing in each movie... (cont. next page) HS / DBS05-2-Conceptual 6

Requirements: Case study (cont)... Not all of our movies have star actors. s like to know each actor s real birth name and age. We track only actors who appear in the movies in our inventory. We have lots of customers. We only rent videos to people who have joined our video club. To belong to our club, they must have good credit. For each club member, we d like to keep their first and last name, current phone numbers, and current address. And, of course each club member has a membership number. Then we need to keep track of what video tapes each customer currently has checked out. A customer may check out multiple video tapes at any given time. Rentals are for one or more days, each movie with an individual price per day. Furthermore we additionally charge 1 $ per beta format tape, 2 $ for a DVD and another $ for movies longer than 2 hours. Maximum rental time is 4 weeks. The customer gets a bill with movie s, individual prices and total amount, when he /she returns movies." HS / DBS05-2-Conceptual 7 Requirement Analysis First step: filter essential information vs unimportant details Essentials - There are customers, tapes, movies,... - A movies may have many copies, but a tape (or DVD) contains exactly one movie - s have a customer identification (id) - Four weeks maximal rental time... Unimportant details - "...DVDs since a few month" - "... John Wayne.." - Names of the categories (but categories are important!) - s on shelf (since we don't design a tape robot)... Note: what is important depends on the applications HS / DBS05-2-Conceptual 8 Requirement Analysis Clarify unclear statements Video club: admission / annual fee? Charge per tape: price for one day the minimum?... Fill gaps Any discounts? What happens after maximal rental time?... Distinguish data from operations Processing a bill Becoming a member of the club... 2.2.1 Basic modeling primitives Conceptual modeling Distinguish between types (classes) and individual facts (metadata vs data) The name of this woman is Kunz with first name Tamara. As opposed to: A person is identified by first name, last name and birth date. Describe reality on a type level Use a graphical language in order to get an overall impression of the domain modeled The language should use the "right primitives" HS / DBS05-2-Conceptual 9 This is an old problem of philosophy: how to describe the world in an appropriate, comprehensible way? HS / DBS05-2-Conceptual 10 Basic modeling primitives Modeling the "Real World" Entity (type) something which exists, has a name Attribute property of an entity Relationship connects two or more entities "Non sunt multiplicanda entia praeter necessitatem" William van Ockham, English philosopher, 13th century (Principle of Economy, Law of Parsimony) TID format Important terms TID format recorded_on HS / DBS05-2-Conceptual 11 Basic modeling primitives Attributes have values Example: Starring is John Wayne Values live on the database level, not in the schema! decision: attribute or entity? Example: color is an attribute for describing cars color is presumably an entity for the car manufacturer having attributes like tone, quality, supplier, chemical formula,.. HS / DBS05-2-Conceptual 12

2.2.2 Modeling notations and languages Entity-Relationship-Model data-oriented: static modeling of data 1976 introduced by P.P. Chen (Peter P. Chen: The Entity-Relationship Model - Toward a Unified View of Data. ACM TODS 1(1): 9-36, 1976, see Reader) Classical Graphical notation with squares, bullets and diamond Title LID hours Student attend Lecture Name FName Matr-Nr Email HS / DBS05-2-Conceptual 13 Graphical modeling languages Unified modeling language (UML) Modeling of data and operations Object oriented flavor e.g: each object (entity) has identity - a unique pointer ERM: entities having the same type and the same attribute values are indistinguishable Attributes may be constructed (lists, sets, arrays,) Relationships are directed (uni- or bidirectional) ERM: always bidirectional Student Matr-Nr Name FName {Email} register(lecture x) attend Lecture LID Title Hours assignroom(r r) Called association in UML, may be directed HS / DBS05-2-Conceptual 14 ERM and UML E-R modeling language and UML obviously related E-R language simpler More appropriate for modeling of data Object-oriented modeling by extended E-RM concepts (see below) semantic differences (see below) Drawing "attribute bullets"? Use UML notation for entities and attributes Use association notation of UML instead of diamonds Basically use UML notation with ERM semantics Entity What is an "entity"? particular instance (e.g. the movie "Jurassic Park") The type of an instance / all instances ("movie") sometimes: a set of instances (e.g. all movies of the rental shop) The context should clarify the meaning Sometimes explicitly: entity set / entity type Analog terminology for relationships HS / DBS05-2-Conceptual 15 HS / DBS05-2-Conceptual 16 2.2.3 Entities & attributes entity name attribute list No methods Key attributes "Axiom" of ER and Relational DB: Two individual entities can always be distinguished by the values of some of its attribute(s), together called the key Key attributes are underlined {country} {} multivalued attribut example: first name for entity Person Key attributes together identify an entity. Frequently: just one attribute, e.g. matrnr HS / DBS05-2-Conceptual 17 Relationships Always have a name Do not have a direction May have attributes Do not have a key relates_to <attribute > Terminology: Relationships often called relations. Different from relations of RDM! HS / DBS05-2-Conceptual 18

Conceptual : Comparison with UML UML-Terminology Class = entity type (- Attribute = member) Object = entity Association = relationship NO keys Relationship may have a direction relates_to <attribute > HS / DBS05-2-Conceptual 19 Notation sometimes attributes are omitted Infrequent: order of relationship Role names rented_by renter roles rental object HS / DBS05-2-Conceptual 20 Recursive relationships Multiple relationships name first_name position salary <rel 1> <Entity > <Entity > <rel n> There may be no, one or many relationships between entity types Roles: particularly useful in recursive relations subordinate boss Person parent child has is_ Person performs_in Note: nothing said about representation (implementation) at this point HS / DBS05-2-Conceptual 21 HS / DBS05-2-Conceptual 22 Both example model hierarchical relationships Domains and types Attributes may be typed Representation of data not really relevant at this stage : VARCHAR /* variable character string? More important: domain Semantic category which characterizes attributes of the same kind : nameorsentence Domains not used frequently Type / domain assignment mostly done in a separate step 2.2.3 From requirements to models Text to conceptual model The only step which cannot be automated Given: Requirements as "cleaned" text Wanted: conceptual database design Rough guideline: correspondance between entities and nouns For each movie, we... relationships and verbs... which movie a tape holds... attributes and adjectives or phrases like has a.., is...a...has a tape number. HS / DBS05-2-Conceptual 23 HS / DBS05-2-Conceptual 24

From requirements to models Some heuristics: entities If it cannot be uniquely identified, it usually isn t an entity video club If only one instance exists, it might not be an instance video store Find out synonyms (in this context) customer and club member Give a definition of the entity and eliminate synonyms a customer is a member of the club. Only customers may rent videos. is synonym to club member. From requirements to models Heuristics: attributes Find the attributes for each entity. Sometimes expressed by auxiliary verb: has a tape number Which one identifies an instance? In most cases not expressed explicitly but context knowledge : name, first_name, phone, address, membership# Decompose compound attributes (e.g. address location, street, zip) Check for multiple values Use lower case for attributes, uppercase for entities HS / DBS05-2-Conceptual 25 HS / DBS05-2-Conceptual 26 From requirements to models: case study I m the owner of a small video store. We have over 3.000 video tapes that we need to keep track of. Since a few weeks, we also have DVDs. Each of our video tapes has a tape number. For each movie, we need to know its and category (e.g. comedy, suspense, drama, action, or sci-fi). Yes, we do have multiple copies of many of our movies. We give each movie a specific id, and then track which movie a tape contains. A tape may be either Beta or VHS Format. We always have at least one tape for each movie we track, and each tape is always a copy of a single, specific movie. Our tapes are adapted to the movie lengths, so we don t have any movies which require multiple tapes. The movies are stored on shelfs according to their category sorted by movie. We are frequently asked for movies starring specific actors John Wayne and Katherine Hepburn are always popular. So we d like to keep track of the star actors appearing in each movie. Not all of our movies have star actors. s like to know each actor s real birth name and age. We track only actors who appear in the movies HS / DBS05-2-Conceptual 27 in our inventory.... etc Conceptual : case study Format format: String extrach: Money has id: Number acqdate: Date From: DateTime Until: DateTime recorded_on name: String f_name: String mem_no: No {phone: PhoneNo} streetno: String zip: Zipcode City: String : String category: String price_day: Money : Name : Date length: Time starring Actor stagename: Name real_name: Name birth_date: Date HS / DBS05-2-Conceptual 28 Summary Conceptual modeling: the art of structuring the data of an application domain Base: careful requirement analysis Simple, powerful base constructs: entities, attributes, relationships Visual (graphical) language E-R modeling language and UML related E-R language simpler More appropriate for modeling of data many dialects Compatibility to UML makes sense Some differences, e.g. no keys in UML HS / DBS05-2-Conceptual 29