Jerry Post Copyright © 2001 1 Database Management Systems Chapter 2 Database Design.

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Chapter 10: Designing Databases
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Database Design & Mapping
Jerry Post McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Database Management Systems Chapter 2 Database Design.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
Chapter 2 Database System Design (part II)
DATABASE APPLICATION DEVELOPMENT SAK 3408
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Jerry Post Copyright © 2013 DATABASE Database Management Systems Chapter 2 Database Design 1.
Object Oriented Data Base. Traditional Data Models : Hierarchical, Network (since mid- 60’s), Relational (since 1970 and commercially since 1982) Object.
APPENDIX C DESIGNING DATABASES
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Chapter 6: The Traditional Approach to Requirements
Chapter 5: Modeling Systems Requirements: Events and Things
Chapter 2 Database System Design Based on G. Post, DBMS: Designing & Building Business Applications University of Manitoba Asper School of Business 3500.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
ระบบฐานข้อมูลขั้นสูง (Advanced Database Systems) Lecturer AJ. Suwan Janin Phone:
1 Copyright © 2010 Jerry Post. All rights reserved. Database System Design IS240 – DBMS Lecture #3 – M. E. Kabay, PhD, CISSP-ISSMP Assoc. Prof.
DATABASE DESIGN LECTURE FOUR. Why Design a Database? Goal:  To produce an information system that adds value for the user  Reduce costs  Increase sales/revenue.
Systems Analysis and Design in a Changing World, Fifth Edition
MIS 327 Database Management system 1 MIS 327: DBMS Dr. Monther Tarawneh Dr. Monther Tarawneh Week 6: Database Design: Example Rolling Thunder.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
1 INTRODUCTION TO DATABASE MANAGEMENT SYSTEM L E C T U R E
9/14/2012ISC329 Isabelle Bichindaritz1 Database System Life Cycle.
Chapter 14 Information System Development
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 8 Slide 1 Chapter 9 Structuring System Data Requirements.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 Chapter 15 Methodology Conceptual Databases Design Transparencies Last Updated: April 2011 By M. Arief
MIS 301 Information Systems in Organizations Dave Salisbury ( )
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
Conceptual Database Design
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Introduction to MIS1 Copyright © 1998 by Jerry Post Introduction to MIS Chapter 3 Review Solving Business Problems.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
© 2007 by Prentice Hall1-1 Chapter 1 Introduction to Relational Database Systems and Oracle 10g Introduction to Oracle 10g James Perry and Gerald Post.
SYSTEMSDESIGNANALYSIS 1 Chapter 22 Object-Oriented Design Jerry Post Copyright © 1997.
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
All Powder Board and Ski Microsoft Access Workbook Chapter 2: Database Design Jerry Post Copyright © 2003.
1 DATABASES. 2 Conventional Files versus the Database File – a collection of similar records.  Files are unrelated to each other except in the code of.
School of Computer & Communication of LNPU 辽宁石油化工大学计算机与通信工程学院 刘旸 1 Chapter 2 Database Design 第二章 数据库设计 数据库管理系统 Database Management Systems.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
DATABASE MIS 327 Advanced Database 1. DATABASE 2 Objectives  Why are models important in designing systems?  How do you begin a database project? 
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Chapter 1 Introduction.
Databases Chapter 9 Asfia Rahman.
Business System Development
Chapter 2: Database Design All Powder Board and Ski
All Powder Board and Ski
Database System Design
Object Relationships Jerry Post Copyright © 1997
Lecture 10 Structuring System Requirements: Conceptual Data Modeling
Presentation transcript:

Jerry Post Copyright © Database Management Systems Chapter 2 Database Design

DATABASE 2 Database System Design User views of data. Conceptual data model. Implementation (relational) data model. Physical data storage. Class diagram that shows business entities, relationships, and rules. List of nicely-behaved tables. Use data normalization to derive the list. Indexes and storage methods to improve performance.

DATABASE 3 The Need for Design  Goal: To produce an information system that adds value for the user  Reduce costs  Increase sales/revenue  Provide competitive advantage  Objective: To understand the system  To improve it  To communicate with users and IT staff  Methodology: Build models of the system

DATABASE 4 Designing Systems  Designs are a model of existing & proposed systems  They provide a picture or representation of reality  They are a simplification  Someone should be able to read your design (model) and describe the features of the actual system.  You build models by talking with the users  Identify processes  Identify objects  Determine current problems and future needs  Collect user documents (views)  Break complex systems into pieces and levels

DATABASE 5 Design Stages  Initiation  Scope  Feasibility  Cost & Time estimates  Requirements Analysis  User Views & Needs Forms Reports  Processes & Events  Objects & Attributes  Conceptual Design  Models Data flow diagram Entity Relationships Objects  User feedback  Physical Design  Table definitions  Application development Queries Forms Reports Application integration  Data storage  Security  Procedures  Implementation  Training  Purchases  Data conversion  Installation  Evaluation & Review

DATABASE 6 Initial Steps of Design 1.Identify the exact goals of the system. 2.Talk with the users to identify the basic forms and reports. 3.Identify the data items to be stored. 4.Design the classes (tables) and relationships. 5.Identify any business constraints. 6.Verify the design matches the business rules.

DATABASE 7 Unified Modeling Language (UML) A relatively new method to design systems. Contains several types of diagrams: The class diagram is the most important for database design.

DATABASE 8 Definitions Entity:Something in the real world that we wish to describe or track. Class: Description of an entity, that includes its attributes (properties) and behavior (methods). Object:One instance of a class with specific data. Property:A characteristic or descriptor of a class or entity. Method:A function that is performed by the class. Association:A relationship between two or more classes. Entity:Customer, Merchandise, Sales Class: Customer, Merchandise, Sale Object:Joe Jones, Premium Cat Food, Sale #32 Property:LastName, Description, SaleDate Method:AddCustomer, UpdateInventory, ComputeTotal Association:Each Sale can have only one Customer. Pet Store Examples

DATABASE 9 Associations  General  One-to-one(1:1)  One-to-many(1:M)  Many-to-many(M:N)  Relationships represent business rules  Sometimes common-sense  Sometimes unique to an organization  Users often know current relationships, rarely future  Objects related to objects  An employee can work in only one department  Many departments can work on many different products  Objects related to properties  An employee can have only one name  Many employees can have the same last name 1* AnimalBreed ** performs  TasksEmp 1* places  SaleCust. places  1* Purch. Order Supplier  sent to

DATABASE 10 Class Diagram  Class/Entity(box)  Association/Relationship  Lines  Minimum 0: optional 1: required  Maximum Arrows 1, M Customer Order Item 1 … 1 0 … * 1 … *..

DATABASE 11 Sample Association Rules (Multiplicity)  An order must have exactly 1 customer,  1 … 1Minimum of 1  1 … 1Maximum of 1  And at least one item.  1 … *Minimum of 1  1 … *Maximum many  An item can show up on no orders or many orders.  0 … *Optional (0)  0 … *Maximum many Customer Sale Item 1 … 1 0 … * 1 … *

DATABASE 12 N-ary Associations  Associations can connect more than two classes.  Associations can become classes.  Events  Many-to-many  Need to keep data  Example has two many-to-many relationships.  We know which components go into each product.  We know which employees worked on a product.  We need to expand the relationships to show which employees installed which components into each product.  Each assembly entry lists one employee, one component, and one product.  By appearing on many assembly rows, the many-to- many relationships can still exist. Employee Component Product * * **

DATABASE 13 N-ary Association Example Employee Name... Component CompID Type Name Product ProductID Type Name * ** Assembly EmployeeID CompID ProductID Multiplicity is defined as the number of items that could appear if the other N-1 objects are fixed. Almost always “many.”

DATABASE 14 Association Details: Aggregation Sale SaleDate Employee Item Description Cost * * contains  Aggregation: the Sale consists of a set of Items being sold.

DATABASE 15 Association Details: Composition Bicycle Size Model Type … Wheels Rims Spokes … 12 built from  Composition: aggregation where the components become the new object. Crank ItemID Weight Stem ItemID Weight Size Bicycle Size Model Type … Wheels Crank Stem Two ways to display composition.

DATABASE 16 Association Details: Generalization Animal DateBorn Name Gender Color ListPrice Mammal LitterSize TailLength Claws Fish FreshWater ScaleCondition Spider Venomous Habitat {disjoint}

DATABASE 17 Inheritance  Class Definition-- encapsulation  Class Name  Properties  Methods  Inheritance Relationships  Generic classes  Focus on differences  Polymorphism  Most existing DBMS do not handle inheritance Accounts AccountID CustomerID DateOpened CurrentBalance OpenAccount CloseAccount Class name Properties Methods Savings Accounts InterestRate PayInterest Checking Accounts MinimumBalance Overdrafts BillOverdraftFees CloseAccount Inheritance Polymorphism

DATABASE 18 Multiple Parents Vehicle Human Powered MotorizedOn-RoadOff-Road CarBicycle or

DATABASE 19 Association Details: Reflexive Relationship Employee manager 0…1 worker *  manages A reflexive relationship is an association from one class back to itself. In this example, an employee can also be a manager of other employees.

DATABASE 20 Defining Packages for High-Level Views Purchase Animals Purchase Merchandise Sell Animals Sell Merchandise EmployeeSupplierCustomer

DATABASE 21 PetStore Overview Class Diagram Animal CustomerSupplier Merchandise Animal Purchase Merchandise Purchase SaleEmployee * 1 * 1 1 ** 1 1 * * 1 * * * * *1*1

DATABASE 22 Pet Store Class Diagram: Access

DATABASE 23 Data Types (Domain)  Common data types  Text Fixed length1 to 64 K bytes Variable length1 to 2 G bytes  Memo/Note  Numeric Byte1 byte0 to 255 Boolean2 bytesTrue or False Integer2 bytes-32,768 to 32,767 (no decimal points) Long4 bytes-2,147,483,648 to 2,147,483,647 (no decimal points) Floating4 bytes E-45 to E38 Double8 bytes E-324 to E308 Currency8 bytes -922,377,203,685, to 922,377,203,685,  Date/Time 8 bytesJan 1, 100 to Dec 31, 9999  Objects/Raw binary Any type of data supported by the machine Pictures, sound, video...

DATABASE 24 Data Domain Comparison

DATABASE 25 Data Type Sizes

DATABASE 26 Computed Attributes Denote computed values with a preceding slash (/). Employee Name DateOfBirth /Age Phone … {Age = Today - DateOfBirth}

DATABASE 27 Event Examples  Business Event  Item is sold.  Decrease Inventory count.  Data Event  Inventory drops below preset level.  Order more inventory.  User Event  User clicks on icon.  Send purchase order to supplier. ON (QuantityOnHand < 100) THEN Notify Purchasing Manager Trigger

DATABASE 28 Event Triggers  Business Process: Ship Product  Trigger: Inventory Change  Executes function/trigger in Inventory object. Order … ShipOrder … Inventory … Subtract Analyze … 1. Subtract(Prod, Qty sold) 1.1 Analyze (Product) Purchase … Reorder … Reorder (Product, quantity) low  Object: Inventory  Property: Current Inventory.  Function: Update Inventory.  Trigger: On Update, call Analyze function.  Process: Analyze Inventory  Function: Determine need to reorder.  Trigger: Generate new order. Inventory … Subtract Analyze …

DATABASE 29 Design Importance: Large Projects  Design is harder on large projects.  Communication with multiple users.  Communication between IT workers.  Need to divide project into pieces for teams.  Finding data/components.  Staff turnover--retraining.  Need to monitor design process.  Scheduling.  Evaluation.  Build systems that can be modified later.  Documentation.  Communication/underlying assumptions and model.

DATABASE 30 Large Projects  Project planning software  Schedules  Gantt charts  CASE tools  Groupware tools  Track changes  Document work  Track revisions  Project Teams  Divide the work  Fit pieces together  Evaluate progress  Standards  Design  Templates  Actions  Events  Objects Naming convention Properties

DATABASE 31 CASE Tools  Computer-Aided Software Engineering  Diagrams (linked)  Data Dictionary  Teamwork  Prototyping Forms Reports Sample data  Code generation  Reverse Engineering  Examples  Rational Rose  Sterling COOL: Dat COOL: Jex (UML)  Oracle  IBM

DATABASE 32 Rolling Thunder: Top-Level SalesAssembly PurchasingLocation Bicycle Employee

DATABASE 33 Rolling Thunder: Sales Customer CustomerID Phone FirstName LastName Address ZipCode CityID BalanceDue Customer Transaction CustomerID TransactionDate EmployeeID Amount Description Reference Retail Store StoreID StoreName Phone ContactFirstName ContactLastName Address ZipCode CityID Bicycle::Bicycle BicycleID … CustomerID StoreID … 1…1 0…* 1…1 0…* 0…1

DATABASE 34 Rolling Thunder: Bicycle Bicycle SerialNumber CustomerID ModelType PaintID FrameSize OrderDate StartDate ShipDate ShipEmployee FrameAssembler Painter Construction WaterBottleBrazeOn CustomName LetterStyleID StoreID EmployeeID TopTube ChainStay … 1…1 ModelType Description Paint PaintID ColorName ColorStyle ColorList DateIntroduced DateDiscontinued LetterStyle LetterStyleID Description BicycleTubeUsed SerialNumber TubeID Quantity BikeParts SerialNumber ComponentID SubstituteID Location Quantity DateInstalled EmployeeID 1…* 0…* 1…1 0…* 1…1

DATABASE 35 Rolling Thunder: Assembly Bicycle::BikeParts SerialNumber ComponentID... 1…1 Component ComponentID ManufacturerID ProductNumber Road Category Length Height Width Description ListPrice EstimatedCost QuantityOnHand ComponentName AssemblyOrder Description GroupComponents GroupID ComponentID Groupo GroupID GroupName BikeType Bicycle:: BicycleTubeUsed SerialNumber TubeID Quantity TubeMaterial TubeID Material Description Diameter … 0…* 1…1 0…* 1…1 0…* 1…1 0…* 1…1

DATABASE 36 Rolling Thunder: Purchasing PurchaseOrder PurchaseID EmployeeID ManufacturerID TotalList ShippingCost Discount OrderDate ReceiveDate AmountDue 1…1 PurchaseItem PurchaseID ComponentID PricePaid Quantity QuantityReceived Manufacturer ManufacturerID ManufacturerName ContactName Phone Address ZipCode CityID BalanceDue ManufacturerTrans ManufacturerID TransactionDate Reference EmployeeID Amount Description Assembly:: Component ComponentID ManufacturerID ProductNumber 0…* 1…1 0…* 1…1 1…* 0…*

DATABASE 37 Rolling Thunder: Location City CityID ZipCode City State AreaCode Population1990 Population1980 Country Latitude Longitude Sales:: Customer CustomerID … CityID Sales:: RetailStore StoreID … CityID Employee:: Employee EmployeeID … CityID Purchasing:: Manufacturer ManufacturerID … CityID 0…* 1…1 0…* StateTaxRate State TaxRate 1…1 0…1

DATABASE 38 Rolling Thunder: Employee Employee EmployeeID TaxpayerID LastName FirstName HomePhone Address ZipCode CityID DateHired DateReleased CurrentManager SalaryGrade Salary Title WorkArea Bicycle:: Bicycle SerialNumber … EmployeeID ShipEmployee FrameAssembler Painter Bicycle:: BikeParts SerialNumber ComponentID … EmployeeID Purchasing:: PurchaseOrder PurchaseID … EmployeeID 1…1 0…* 1…1 0…* manager manages  worker 0…* 0…1

DATABASE 39 Rolling Thunder: Combined

DATABASE 40 Application Design  Simple form based on one table (Animal).  But also need lookup tables for Category and Breed.