Anskaffelse og kravspecifikation UID16_Datamodels.

Slides:



Advertisements
Similar presentations
More Diagramming & Practice with Relationship Modeling
Advertisements

Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
Chapter 10: Designing Databases
Chapter 6: Entity-Relationship Model (part I)
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Anskaffelse og kravspecifikation SR9_Checking. SR9: Checking and validation Kilder SR: Soren Lauesen: Software requirements - Styles and techniques. Addison-Wesley,
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Plancher til Anskaffelse og kravspecifikation, Forår 2007 Lauesen: Software requirements - Styles and techniques 4. Functional details Plancherne stammer.
Anskaffelse og kravspecifikation SR4_FuncDetail. Russisk MIG.
Entity Relationship Diagrams
Anskaffelse og kravspecifikation SR3_Functions - undtagen tasks.
Slides for: Software requirements - Styles and techniques Soren Lauesen 2. Data requirement styles January 2007 Slides covered by the compendium are omitted.
Lesson-19 Data Modeling and Analysis
Chapter 3: Data Modeling
Slides for: Software requirements - Styles and techniques Soren Lauesen 3. Functional requirement styles January 2007 Slides covered by the compendium.
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
Entity/Relationship Modelling
APPENDIX C DESIGNING DATABASES
MIS2502: Data Analytics Relational Data Modeling
Entity-Relationship Design
Introduction to Databases
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
IS550: Software requirements engineering
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Concepts and Terminology Introduction to Database.
Databases Introduction. What is a Database? A DATABASE is a collection of related data. –Data is just another name for information.
Slides for User interface design A software engineering perspective Soren Lauesen 12. User documentation and support August 2006 © 2005, Pearson Education.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
CSC 240 (Blum)1 Introduction to Database. CSC 240 (Blum)2 Data versus Information When people distinguish between data and information, –Data is simply.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
SQL Structured Query Language Programming Course.
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.
Slides for User interface design A software engineering perspective Soren Lauesen 2. Prototyping and iterative design August 2006 © 2005, Pearson Education.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Domain Model—Part 2: Attributes.  A logical data value of an object  (Text, p. 158)  In a domain model, attributes and their data types should be simple,
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
Copyright © Curt Hill Entities and Relationships The basics and what they have to do with database.
Use of ICT in Data Management AS Applied ICT. Back to Contents Back to Contents.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS2502: Data Analytics Relational Data Modeling
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Slides for User interface design A software engineering perspective Soren Lauesen 13. More on usability testing August 2006 © 2005, Pearson Education retains.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 16 July 26,2012 Data Modeling using the Entity Relationship.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Anskaffelse og kravspecifikation
Data Modeling Using the Entity- Relationship (ER) Model
Anskaffelse og kravspecifikation
Database, tables and normal forms
MIS2502: Data Analytics Relational Data Modeling
© 2014 by McGraw-Hill Education. This is proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
DESIGNING DATABASE APPLICATIONS
Chapter 5: Logical Database Design and the Relational Model
Software acquisition and requirements SR3_Functions - except tasks
Entity-Relationship Model and Diagrams (continued)
MIS2502: Data Analytics Relational Data Modeling
Chapter 17 Designing Databases
MIS2502: Data Analytics Relational Data Modeling 2
Instructor Materials Chapter 5: Ensuring Integrity
Presentation transcript:

Anskaffelse og kravspecifikation UID16_Datamodels

UID16: Data models Kilder UID: Soren Lauesen: User interface design - A software engineering perspective. Addison- Wesley, Fra kapitel 16. SR: En enkelt slide er fra Soren Lauesen: Software requirements - Styles and techniques. Addison-Wesley, © 2002, 2005, Pearson Education retains the copyright to the slides from the books, but allows restricted copying for teaching purposes only. It is a condition that the source and copyright notice is preserved on all the material. Bits and pieces for making E/R diagrams A B A B stayID, paymethod

Guests Rooms All guests in the database One guest may have several stays. One stay has only one guest One stay may com- prise many rooms. One room may be used for many stays. Stays Boxes with index cards Guest Stay Room 1:m One-to-many relationship m:m Many-to-many relationship A class contains: objects = entities  records Class = entity class  table Entity-relationship data model 3. UID16.1 E/R data model for a hotel

Guest Stay Room 1:m One-to-many relationship m:m Many-to-many relationship A class contains: objects = entities  records Class = entity class  table Entity-relationship data model 4. Extra: Some index cards Guest Name: Address: Phone: Passport: John Simpson 456 Orange … … Room roomID: bedCount: Type: Price 1: Price 2: 12 2 Double Stay Pay by: Date Room /812 24/812 24/811 visa E/R model: Lists forbidden on a card Put the date here?

5. UID16.2 Attributes and keys name, address, phone, passport stayID, paymethod, roomID, bedCount, type price1, price2 Fields = attributes Key field: Unique identification Guest Stay Room Guests Rooms Stays date

6. UID16.3A Resolve m:m with connection class name, address, phone, passport stayID, paymethod roomID, bedCount, type price1, price2 personCount, state (booked | occ | repair) Guest Stay RoomState Room Guests Rooms Stays RoomStates enumeration type date

Stay Service Type name, price Guest Stay Room State Room Service Received Service Type date, personCount, state (booked | occupied | repair) name, address1, address2, address3, phone, passport roomID, bedCount, type price1, price2 name, price date, quantity Guest stayID, paymethod, state (booked | in | out | canceled) E.g. Full breakfast 6$, Continental 4$, Telephone... Add to ServiceReceived: serviceType (fullBreakfast | continental |... ) Remove this class? 7. UID16.3B Hotel data model

Guest Stay RoomState Room 8. UID16.4 Relational data model Guest Stay RoomState Room stayIDguestIDpaymethod Cash Visa roomIDprice stayIDroomIDdatestate /8occ /8occ /8booked /8occ guestIDnameaddress John Si Orange Gr 33Lise Ha...Dysseg Yun ChenKirch... 6 Table (relation) Record Foreign key, reference Primary key - artificial Primary key - natural Using the database Who stays in room 11 today 24/8? Which rooms has John Simpson today? Guest Thomson books, what happens? Guest 38 is to be deleted - how? Total amount for room 13? Composite key

9. UID16.5 Data sources CarOwner A domain word may become: an entity an attribute a relationship something outside the model printout/computation “noise” Official source text When a car is registrated it gets a license number (shown on the license plate). The Vehicle Office also records the owner’s name and address, civil registration number or company tax file number, the make (producer and model), chassis number, fuel type (gas, diesel,...) and the registration date. The vehicle office sends a registration certificate to the primary owner or user, but it doesn’t show the civil registration number or the company registration number. More than one owner and user may be recorded. ?

10. UID16.6 Data dictionary D1:Class: Guest [Notes a, b... refer to guidelines] The guest is the person or company who has to pay the bill. A person has one or more stay records. A company may have none [b, c]. “Customer” is a synonym for guest, but in the database we only use “guest” [a]. The persons staying in the rooms are also called guests, but are not guests in database terms [a]. Examples E1.A guest who stays one night. E2.A company with employees staying now and then, each of them with his own stay record where his name is recorded [d]. E3.A guest with several rooms within the same stay. Attributes 1. name:Text, 50 chars [h] 2. passport:Text, 16 chars [h] Attribute missing in data model Guidelines for classes. Explain: a)Name in the system vs. name in domain b) Relationships to other classes c) Cases where connections are missing d) Concerns when creating or deleting an entity e) Typical and unusual examples

11. UID16.6 Data dictionary (cont.) D1:Class: Guest [Notes a, b... refer to guidelines] The guest is the person or company who has to pay the bill. A person has one or more stay records. A company may have none [b, c]. “Customer” is a synonym for guest, but in the database we only use “guest” [a]. The persons staying in the rooms are also called guests, but are not guests in database terms [a]. Examples E1.A guest who stays one night. E2.A company with employees staying now and then, each of them with his own stay record where his name is recorded [d]. E3.A guest with several rooms within the same stay. Attributes 1. name:Text, 50 chars [h] 2. passport:Text, 16 chars [h] Recorded for guests who are obviously foreigners [f, i]. Used for police reports in case the guest doesn’t pay [g]... The name stated by the guest [f]. For companies the official name since the bill is sent there [g]. Longer names exist, but better truncate at registration time than at print out time [g, j]. Guidelines for attributes. Explain: f) From where in the domain do we get the values? g) What are they used for in the domain? h) Possible values i)Special values, e.g. blanks, and when j)Typical and unusual examples

12. UID16.7 Network model: Flight routes Chicago ColumbusWashington NewYork AA331 Route City Route: AA331. Mon, Wed ArrDep Chicago10:45 Columbus11:4012:20 Washington13:3014:15 New York15:10 Leg Route Leg City Next 1:1 relation From To attributes?

13. UID16.8 Example: Text processor Character Paragraph Document alignment, indentation, spacing... margin, paperSize, headers, columns font, underline... fileName, zoom Section Style ?? Picture ?? Shape ??

14. UID16.9 Hierarchies D1 D1.1D1.2D1.3 D1.1.1D1.1.2D1.3.1D1.3.2 HeadQt Dept SubDept Project projID, name, (headqtID, deptID, sDeptID) headqtID, name deptID, name, (headqtID) sDeptID, name, (deptID)

D1 D1.1D1.2D1.3 D1.1.1D1.1.2D1.3.1D1.3.2 DeptProject projID, name ? has belongs Dept deptIDnamebelongsTo D1HeadQt D1.1SalesD1 D1.2PersonnelD1 D1.3Development D1 D1.1.1SydneyD1.1 D1.1.2MelbourneD1.1 D1.3.1HardwareD1.3 D1.3.2SoftwareD UID16.9 Hierarchies (cont.)

16. UID16.10 Network model: road map Road ?? Section ?? Point ?? Copyright Melway Publishing Pty Ltd. Reproduced from Melway Edition 31 with permission.

17. UID16.11 Sub-classes: Internet car broker Customer custID phone1 phone2 Advertisement fromDate toDate make year miles color state price text announce see? Attributes in UML way Class Dealer name address... Private userID cardID expiry Sub-classes E/R solution 1: Constraint - Priv or Dealer Customer Dealer Private custID, phone1... subClass (priv|dealer) custID, userID...custID, name...

Customer custID phone1 phone2 Advertisement fromDate toDate make year miles color state price text announce see? Attributes in UML way Class Dealer name address... Private userID cardID expiry Cust&Priv Dealer E/R solution 2: Always space for Private E/R solution 3: Customer may have several roles. All possible attributes. Many nil - depending on role. Customer Role role (private | dealer | reader), userID, name, address, cardID, expiry, custID 18. UID16.11 Sub-classes (cont.)

A A 1:m variants: Each A has zero or more Bs Each B has one A Each A has one or more Bs Each B has zero or one A Cardinality : A Each A owns one or more Bs Each B belongs to one A owns belongs Referential integrity B B B A B 1:1 variant: Each A has a B (don’t know about zero) Each B has zero or one A m:m variant Each A has one or more Bs Each B has zero or more As A B 19. UID16.12A Notational variations

A B 1:1 1:  UML notation Each A has one or more Bs Each B has one A A B 0:11:99 Each A has one to 99 Bs Each B has zero or one A Stay RoomState 1:m: Move attributes to RoomState and make a 1:m crow’s foot. date, state Stay Room #persons Diamond notation m:m: Make diamond a connection class m m m UID16.12A Notational variations (cont.)

21. SR2.2F Transformation rules A B C A C A B C A C Two feet facing the same way make one long foot Two feet facing opposite ways make many-to-many Stay Room Stay Room state Room Resolve many- to-many with a connection box

Line Class activity Request hour Room hour Room Contract period Activity Class hours Time table User authoriz Authoriz type Room property Property wish Room wish Building wish Building 1:1 0:  1:  1:1 0:  0:1 1:  1:1 0:  1:1 1:  1:1 0:  0:1 1:1 0:  1:1 1:  1:1 0:  1:1 0:  0:1 0:  1:1 0:  1:1 0:1 1:1 0:1 0:  1:  0:  22. UID16.12B UML and broken connectors

Line Class activity Request hour Room hour Room Contract period Activity Class hours Time table User authoriz Authoriz type Room property Property wish Room wish Building wish Building 23. UID16.12B Room allocation system in E/R notation

24. UID16.14A Normalization and first normal form First normal form: For each primary key, there must be a fixed number of fields of fixed length. Variable length attribute Purpose: Avoid redundancy (same data several places) Find the “true” objects Ensure “table format” Employee qualifications empIDnamedeptIDdeptNameCourses 100Thomson5SalesWindows, Word, Access 101Smith7AccountingWord 102Bunting5SalesWord, Access Course list Employee qualifications empIDnamedeptIDdeptNamecourseIDcourseNameyear 100Thomson5Sales1Windows Thomson5Sales2Word Thomson5Sales3Access Smith7Accounting2Word Bunting5Sales2Word Bunting5Sales3Access2001 Fixed length attributes Key repeatedRedundancy Variable number of fields for same key

Cure: Move variable-length stuff to a separate table. CoursesTaken empIDcourseIDcourseNameyear 1001Windows Word Access Word Word Access2001 EmployeeCourseTaken Employees empIDnamedeptIDdeptName 100Thomson5Sales 101Smith7Accounting 102Bunting5Sales 25. UID16.14A Normalization and first normal form (cont.)

26. UID16.14B Second normal form Second normal form: First normal form + Non-key fields must depend on entire key. Doesn’t depend on empID CoursesTaken empIDcourseIDcourseNameyear 1001Windows Word Access Word Word Access2001 Cure: Move fields depending on a partial key to a separate table. CoursesTaken empIDcourseIDyear Courses courseIDcourseName 1Windows 2Word 3Access CourseCourseTaken

27. UID16.14C Third normal form & final model Third normal form: Second normal form + Non-key fields must be independent. Employees empIDnamedeptIDdeptName 100Thomson5Sales 101Smith7Accounting 102Bunting5Sales Depends only on deptID Omit deptID and use deptName as the key? Cure: Move interdependent fields to a separate table. DepartmentEmployee Employees empIDnamedeptID 100Thomson5 101Smith7 102Bunting5 Departments deptIDdeptName 5Sales 7Accounting CourseCourseTaken name year deptName courseName

28. UID16.14D Hotel system normalization Rooms roomIDtypebedCountprice1price2 011Double, bath Single, toilet Double, bath Single, toilet Double, bath Single, bath Depend only on type Hard to change prices for 400 rooms Rooms roomIDroomType RoomTypes roomTypedescriptionbedCountprice1price2 1Double, bath Double, toilet Single, toilet160 4Single, bath Third normal form: Easy to change prices for 8 room types