SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Yes! Database Design can be this fun Mark Abramson, CEO, Forward Thought, Inc. 10/9/2011 © 2011 Mark Abramson / #svcc 1 @mark__a
THEORY & ELEMENTS  DEMO Q&A 10/9/2011 © 2011 Mark Abramson / #svcc 2 Edgar F Codd
Microsoft BizSpark Startup Partner Organizer of BizSparkSFMeetup Group Regular customer of all tools used in demo Schema-first kind of guy 10/9/2011 © 2011 Mark Abramson / #svcc 3 Disclosures
What is a database design? 10/9/2011 © 2011 Mark Abramson / #svcc 4
Why Database Design? Gives everyone a clear picture of your business rules and the data behind it Build consensus across business units Separation of concerns Ensure data accuracy Fun 10/9/2011 © 2011 Mark Abramson / #svcc 5
Entity / Relationship Model An Entity is some “thing” of interest A Relationship defines the interaction between one or more Entities 10/9/2011 © 2011 Mark Abramson / #svcc 6
What’s the data look like? 10/9/2011 © 2011 Mark Abramson / #svcc 7
Entity Definition Attributes Data Types NULL option Primary Key Foreign Key Identity Columns 10/9/2011 © 2011 Mark Abramson / #svcc 8
Relationship Definition Identifying Non-Identifying 10/9/2011 © 2011 Mark Abramson / #svcc 9 Non-Identifying Relationship
Relationship (2) Recursive references Associative / Many-To-Many /“Join Tables” 10/9/2011 © 2011 Mark Abramson / #svcc 10
Cardinality How many instances of each entity may be involved or must be involved? 10/9/2011 © 2011 Mark Abramson / #svcc 11
Keys Primary Keys Foreign Keys Candidate Keys Composite Keys 10/9/2011 © 2011 Mark Abramson / #svcc 12
Normalization 10/9/2011 © 2011 Mark Abramson / #svcc 13 Denormalization Normalization
Getting Fancy First, second, third-normal form Generalization Nonspecific relations Three-way relationships Constraints Referential Integrity actions Zachman’s Framework 10/9/2011 © 2011 Mark Abramson / #svcc 14
Exercise! Legacy Baggage 10/9/2011 © 2011 Mark Abramson / #svcc 15
Tools for Creating Your Model Paper + Pen / Whiteboard Drawing Tools: PowerPoint, Visio ER Tools: Open Source / Community Editions CA ERWin; Toad; SSMS; MySQL Workbench ER Tools: Midrange Sparx Systems EA $199; Toad $479 ER Tools: High End CA ERWin $4000; Embarcadero $2000 10/9/2011 © 2011 Mark Abramson / #svcc 16
Demo time! SQL Server Management Studio (“free”) http://www.microsoft.com/download/en/details.aspx?id=7593 RedGate SQL Data Generator ($295) http://www.red-gate.com/products/sql-development/sql-data-generator/ RedGate SQL Prompt Pro ($295) http://www.red-gate.com/products/sql-development/sql-prompt/ 10/9/2011 © 2011 Mark Abramson / #svcc 17
Resources 10/9/2011 © 2011 Mark Abramson / #svcc 18 Designing Quality Databases With Idef1X Information Models Thomas A., M.D. Bruce $3.91 on Amazon! SQL in a Nutshell: A Desktop Quick Reference Kevin Kline, Brand Hunt, Daniel Kline $18 on Amazon The Data Model Resource Book, Vol. 1: A Library of Universal Data Models for All Enterprises Len Silverston $45 (also check out Vol. 2 and Vol. 3) http://www.databaseanswers.org/data_models Repository of simple examples of db models Free! http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.data.doc/refs/rdmindex.htm IBM WebSphere data model Also search for ER Diagrams for other large systems to see how someone else addressed a set of entities and relationships (MS Dynamics, SAP, etc.) Image Credits Slide 1: flickr/besser.jetzt Slide 2: IBM Slide 3: flickr/Pete Reed Slide 4: flickr/Artful Magpie Slide 14: Amazon.com Slide 15: flickr/Jon Ashcroft All ER diagrams: Mark Abramson www.StackOverflow.com
10/9/2011 © 2011 Mark Abramson / #svcc 19 SV Code Camp Peter Kellner Edgar Codd Attendees Loving Wife Thomas Bruce Mom + Dad

Weitere ähnliche Inhalte

Ähnlich wie Introduction to Database Design with Entity Relationship Diagrams

CEFRIEL-DEI_DellaValle-Facca_SWE-ET
CEFRIEL-DEI_DellaValle-Facca_SWE-ETCEFRIEL-DEI_DellaValle-Facca_SWE-ET
CEFRIEL-DEI_DellaValle-Facca_SWE-ETEmanuele Della Valle
 
Soprex framework on .net in action
Soprex framework on .net in actionSoprex framework on .net in action
Soprex framework on .net in actionMilan Vukoje
 
Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1Dennis Perlot
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2ukdpe
 
2015-05-19-resume
2015-05-19-resume2015-05-19-resume
2015-05-19-resumeLee Norris
 
Windows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's NewWindows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's NewSascha Corti
 
Brian Hogg - Web Apps using HTML5 and JS
Brian Hogg - Web Apps using HTML5 and JSBrian Hogg - Web Apps using HTML5 and JS
Brian Hogg - Web Apps using HTML5 and JS#DevTO
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patternsukdpe
 
01 introduction to entity framework
01   introduction to entity framework01   introduction to entity framework
01 introduction to entity frameworkMaxim Shaptala
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentationguest0df6b0
 
Curriculum Vitae - Simon Teff - 2016
Curriculum Vitae - Simon Teff - 2016Curriculum Vitae - Simon Teff - 2016
Curriculum Vitae - Simon Teff - 2016Simon Teff
 
Workflow Design to Increase Compliance with Oracle Workflow / Oracle APEX
Workflow Design to Increase Compliance with Oracle Workflow / Oracle APEXWorkflow Design to Increase Compliance with Oracle Workflow / Oracle APEX
Workflow Design to Increase Compliance with Oracle Workflow / Oracle APEXRachelBarker26
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?ukdpe
 
Asp.net Web Development.pdf
Asp.net Web Development.pdfAsp.net Web Development.pdf
Asp.net Web Development.pdfAbanti Aazmin
 
Application Engine ETL
Application Engine ETLApplication Engine ETL
Application Engine ETLkabrilake
 
Microsoft Technologies for Data Science sql_saturday_201505
Microsoft Technologies for Data Science sql_saturday_201505Microsoft Technologies for Data Science sql_saturday_201505
Microsoft Technologies for Data Science sql_saturday_201505Mark Tabladillo
 
Building a Testable Data Access Layer
Building a Testable Data Access LayerBuilding a Testable Data Access Layer
Building a Testable Data Access LayerTodd Anglin
 

Ähnlich wie Introduction to Database Design with Entity Relationship Diagrams (20)

CEFRIEL-DEI_DellaValle-Facca_SWE-ET
CEFRIEL-DEI_DellaValle-Facca_SWE-ETCEFRIEL-DEI_DellaValle-Facca_SWE-ET
CEFRIEL-DEI_DellaValle-Facca_SWE-ET
 
Soprex framework on .net in action
Soprex framework on .net in actionSoprex framework on .net in action
Soprex framework on .net in action
 
Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
Resume
ResumeResume
Resume
 
2015-05-19-resume
2015-05-19-resume2015-05-19-resume
2015-05-19-resume
 
Windows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's NewWindows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's New
 
Brian Hogg - Web Apps using HTML5 and JS
Brian Hogg - Web Apps using HTML5 and JSBrian Hogg - Web Apps using HTML5 and JS
Brian Hogg - Web Apps using HTML5 and JS
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
01 introduction to entity framework
01   introduction to entity framework01   introduction to entity framework
01 introduction to entity framework
 
01 introduction to entity framework
01   introduction to entity framework01   introduction to entity framework
01 introduction to entity framework
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
 
Curriculum Vitae - Simon Teff - 2016
Curriculum Vitae - Simon Teff - 2016Curriculum Vitae - Simon Teff - 2016
Curriculum Vitae - Simon Teff - 2016
 
resume-SIddharthLamba
resume-SIddharthLambaresume-SIddharthLamba
resume-SIddharthLamba
 
Workflow Design to Increase Compliance with Oracle Workflow / Oracle APEX
Workflow Design to Increase Compliance with Oracle Workflow / Oracle APEXWorkflow Design to Increase Compliance with Oracle Workflow / Oracle APEX
Workflow Design to Increase Compliance with Oracle Workflow / Oracle APEX
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
Asp.net Web Development.pdf
Asp.net Web Development.pdfAsp.net Web Development.pdf
Asp.net Web Development.pdf
 
Application Engine ETL
Application Engine ETLApplication Engine ETL
Application Engine ETL
 
Microsoft Technologies for Data Science sql_saturday_201505
Microsoft Technologies for Data Science sql_saturday_201505Microsoft Technologies for Data Science sql_saturday_201505
Microsoft Technologies for Data Science sql_saturday_201505
 
Building a Testable Data Access Layer
Building a Testable Data Access LayerBuilding a Testable Data Access Layer
Building a Testable Data Access Layer
 

Kürzlich hochgeladen

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Introduction to Database Design with Entity Relationship Diagrams

  • 1. Yes! Database Design can be this fun Mark Abramson, CEO, Forward Thought, Inc. 10/9/2011 © 2011 Mark Abramson / #svcc 1 @mark__a
  • 2. THEORY & ELEMENTS DEMO Q&A 10/9/2011 © 2011 Mark Abramson / #svcc 2 Edgar F Codd
  • 3. Microsoft BizSpark Startup Partner Organizer of BizSparkSFMeetup Group Regular customer of all tools used in demo Schema-first kind of guy 10/9/2011 © 2011 Mark Abramson / #svcc 3 Disclosures
  • 4. What is a database design? 10/9/2011 © 2011 Mark Abramson / #svcc 4
  • 5. Why Database Design? Gives everyone a clear picture of your business rules and the data behind it Build consensus across business units Separation of concerns Ensure data accuracy Fun 10/9/2011 © 2011 Mark Abramson / #svcc 5
  • 6. Entity / Relationship Model An Entity is some “thing” of interest A Relationship defines the interaction between one or more Entities 10/9/2011 © 2011 Mark Abramson / #svcc 6
  • 7. What’s the data look like? 10/9/2011 © 2011 Mark Abramson / #svcc 7
  • 8. Entity Definition Attributes Data Types NULL option Primary Key Foreign Key Identity Columns 10/9/2011 © 2011 Mark Abramson / #svcc 8
  • 9. Relationship Definition Identifying Non-Identifying 10/9/2011 © 2011 Mark Abramson / #svcc 9 Non-Identifying Relationship
  • 10. Relationship (2) Recursive references Associative / Many-To-Many /“Join Tables” 10/9/2011 © 2011 Mark Abramson / #svcc 10
  • 11. Cardinality How many instances of each entity may be involved or must be involved? 10/9/2011 © 2011 Mark Abramson / #svcc 11
  • 12. Keys Primary Keys Foreign Keys Candidate Keys Composite Keys 10/9/2011 © 2011 Mark Abramson / #svcc 12
  • 13. Normalization 10/9/2011 © 2011 Mark Abramson / #svcc 13 Denormalization Normalization
  • 14. Getting Fancy First, second, third-normal form Generalization Nonspecific relations Three-way relationships Constraints Referential Integrity actions Zachman’s Framework 10/9/2011 © 2011 Mark Abramson / #svcc 14
  • 15. Exercise! Legacy Baggage 10/9/2011 © 2011 Mark Abramson / #svcc 15
  • 16. Tools for Creating Your Model Paper + Pen / Whiteboard Drawing Tools: PowerPoint, Visio ER Tools: Open Source / Community Editions CA ERWin; Toad; SSMS; MySQL Workbench ER Tools: Midrange Sparx Systems EA $199; Toad $479 ER Tools: High End CA ERWin $4000; Embarcadero $2000 10/9/2011 © 2011 Mark Abramson / #svcc 16
  • 17. Demo time! SQL Server Management Studio (“free”) http://www.microsoft.com/download/en/details.aspx?id=7593 RedGate SQL Data Generator ($295) http://www.red-gate.com/products/sql-development/sql-data-generator/ RedGate SQL Prompt Pro ($295) http://www.red-gate.com/products/sql-development/sql-prompt/ 10/9/2011 © 2011 Mark Abramson / #svcc 17
  • 18. Resources 10/9/2011 © 2011 Mark Abramson / #svcc 18 Designing Quality Databases With Idef1X Information Models Thomas A., M.D. Bruce $3.91 on Amazon! SQL in a Nutshell: A Desktop Quick Reference Kevin Kline, Brand Hunt, Daniel Kline $18 on Amazon The Data Model Resource Book, Vol. 1: A Library of Universal Data Models for All Enterprises Len Silverston $45 (also check out Vol. 2 and Vol. 3) http://www.databaseanswers.org/data_models Repository of simple examples of db models Free! http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.data.doc/refs/rdmindex.htm IBM WebSphere data model Also search for ER Diagrams for other large systems to see how someone else addressed a set of entities and relationships (MS Dynamics, SAP, etc.) Image Credits Slide 1: flickr/besser.jetzt Slide 2: IBM Slide 3: flickr/Pete Reed Slide 4: flickr/Artful Magpie Slide 14: Amazon.com Slide 15: flickr/Jon Ashcroft All ER diagrams: Mark Abramson www.StackOverflow.com
  • 19. 10/9/2011 © 2011 Mark Abramson / #svcc 19 SV Code Camp Peter Kellner Edgar Codd Attendees Loving Wife Thomas Bruce Mom + Dad

Hinweis der Redaktion

  1. 25-30 minutes of instruction, 15-20 minutes of demo, 30+ minutes of Q&AI hope I’ll address most of your questions, so write them down + let’s talk about them at the end of the slidesBut if you don’t understand something, please interruptFirst off, I’d like to see where you’re at – where are you with your understanding and experience w/modeling?Comfy with SQL? Write a join query? Have done modeling before? Dealing with someone else’s mess
  2. Edgar F.Codd – British IBM researcher, regarded as the inventor of the relational model for database managementGOALS FOR SESSION: At the end of this session, you should be able to read, understand and create database Entity Relationship diagramsThere will be a couple of exercises for the audience as we go and an Interactive demoQ&A – very curious about what you’re facing out there in the world
  3. Want you to know of any bias that may affect my talkCheck out November 7thMeetup all about Tools, Tools and More Toolswww.bizsparksf.com
  4. Visual representation of the ENTITIES and RELATIONSHIPS between themBased on rules from the real world / your business; Entails a number of rules, standards and guidelinesGreat way to communicate with co-workers, customers, developers; Great working model and critical reference documentYou could consider this as a whole bunch of linked-together Excel worksheets: these fields define the columnsWorking with a model is 50% science, 50% art, 50% experience
  5. C’mon, you have to put all that data *somewhere*!Fun? YES! It’s a great mental exercise that forces you to think through a lot of hard problemsSeparation of Concerns (1974, check Wikipedia)
  6. Entity = object that is important to the business.Entity = the NOUNRelationship = how are these objects/entities relating to one another?Relationship = the VERB; the VERB PHRASE
  7. CustomerId in SalesOrder table references a record/row in the Customer tableWe can look up / refer to related or seemingly unrelated data elsewhere
  8. What’s in a name?Naming conventions – singular vs. plural DESCRIBE THE BUSINESSAttribute = property of an Entity = Columns of database tableData type choice (decimal vs. float vs. money) varchar vs. nvarchar vs. char vs. textNULL option – is this attribute mandatory or required per business rules?Primary Key: unique identifier for each row of dataForeign Key: some other entity’s primary key that appears here due to some relationship between the twoIDENTITY column: guarantees uniqueness and auto-increments (autonumber). (1,1) specifies the SEED and INCREMENT
  9. Not just a Facebook statusA relationship is the “verb” between entities – defines how they interact per business rulesNaming / “writing a sentence”Defines how the entities interactRead the relationship from parent->child (end with the dot)Identifying: the child is dependent on its parent for its identityNon-identifying: may be existence dependent but not identity dependent
  10. Sometimes we end up with odd relationships and don’t know whyAssociative / link / join / junction table: used for many-to-many tablesCan make joins a little more difficult but is a common patternGREAT for when you want to use an entity in other areas, e.g. Customer<->Address and Person<->Address
  11. Cardinality: how many instances of each entity may be involved or must be involved?w/ identifying – there has to be one Customer for some # of Addressw/ non-identifying – no requirement to have a Customer to have an Address (could be an Employee Address, Order Address, etc.)<nothing> One-to-zero-or-more:<P> one to one or more<Z> one to zero or one<N> one to exactly Nw/ non-identifying relationships, these can all be zero-or-one-to…
  12. Primary Key – unique identifying key (can be any data type as long as it’s unique)Foreign Key – some other entity’s PK that appears here because of some relationship with itCandidate Key – Could this work as a PK? What’s are the candidate keys in this table?Composite Key – put a few fields together to get a unique keyStrings? Timestamps? Integers? Decimals?
  13. DENORMALIZED:Data can be duplicated and get out of syncEase of queryingPerformance considerationsNORMALIZED:One “fact” occurs in one place and only one placeRequires you to get the business rules “right”No way to have data concurrency issuesDoes require a lot of joins
  14. Great opportunities for self-directed learningCascading deletes
  15. In some ways it’s easier to create than repair… let’s work together to see how we can improve this modelFirstName/LastName fields long enough?StateProvince field?Website (255) OK?Are all of these fields really OK to be nulls?WTF is OwnerId doing in Country? State?Is StateCode and CountryCode OK for a PK? Why not a bigint?Relationships in wrong directionDenormalizedInfo? What is this? A flag?
  16. Features + benefits of these as you go up/down the food chain