SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Introduction to Database Design / ER Diagrams




          Intro to Database Design
          with Entity-Relationship
                (ER) Diagrams



       Mark Abramson, CEO, Forward Thought, Inc.
   17 May 2012                   © 2012 Mark Abramson / @mark__a   1
Introduction to Database Design / ER Diagrams




                 Pop Quiz!
   17 May 2012                   © 2012 Mark Abramson / @mark__a   2
Introduction to Database Design / ER Diagrams


                                                          THEORY &
                                                          ELEMENTS

                                                                   DEMO

                                                                   Q&A
                           Edgar F Codd
   17 May 2012                   © 2012 Mark Abramson / @mark__a          3
Introduction to Database Design / ER Diagrams


                 About Me (and disclosures)
   •   Schema-first kind of guy
   •   MS BizSpark Startup Partner
   •   www.bizsparksf.com
   •   Friend of Red Gate
   •   @mark__a
   •   linkedin.com/in/abramsonmark



   17 May 2012                   © 2012 Mark Abramson / @mark__a   4
Introduction to Database Design / ER Diagrams


                 What is a database design?




   17 May 2012                   © 2012 Mark Abramson / @mark__a   5
Introduction to Database Design / ER Diagrams


                 What’s the data look like?



 SalesOrderId    OrderStatus   OrderDate   PlacedBy       IsPriorityOrder   CustomerId   CurrencyId
 20001           Shipped       1/5/2011    Bob Smith      0                 3            2
 20002           Fulfillment   5/5/2011    John Doe       1                 2            2
 20003           Placed        5/7/2011    Brenda Lee     0                 3            2



                        CustomerId          CustomerName                    AccountNumber
                        1                   Woolworths                      838382
                        2                   Rick's Café                     291101
                        3                   Mill Valley Market              957588
   17 May 2012                      © 2012 Mark Abramson / @mark__a                            6
Introduction to Database Design / ER Diagrams


                  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


   17 May 2012                   © 2012 Mark Abramson / @mark__a   7
Introduction to Database Design / ER Diagrams


                 Entity / Relationship Model
   • An Entity is some “thing” of interest
   • A Relationship defines the interaction
     between one or more Entities



                                                                   Contains




   17 May 2012                   © 2012 Mark Abramson / @mark__a              8
Introduction to Database Design / ER Diagrams


                                       Entity
   •   Definition
   •   Attributes
   •   Data Types
   •   NULL option
   •   Primary Key
   •   Foreign Key
   •   Identity Columns

   17 May 2012                   © 2012 Mark Abramson / @mark__a   9
Introduction to Database Design / ER Diagrams


                               Relationship
   • Definition
   • Identifying
   • Non-Identifying




                                                                   Non-Identifying Relationship

   17 May 2012                   © 2012 Mark Abramson / @mark__a                                  10
Introduction to Database Design / ER Diagrams


                           Relationship (2)
   • Recursive references
   • Associative / Many-To-Many /
     “Join Tables”




   17 May 2012                   © 2012 Mark Abramson / @mark__a   11
Introduction to Database Design / ER Diagrams


                                 Cardinality
   • How many instances of each entity may be
     involved or must be involved?




   17 May 2012                   © 2012 Mark Abramson / @mark__a   12
Introduction to Database Design / ER Diagrams


                                         Keys
   •   Primary Keys
   •   Foreign Keys
   •   Candidate Keys
   •   Composite Keys




   17 May 2012                   © 2012 Mark Abramson / @mark__a   13
Introduction to Database Design / ER Diagrams


                                 Normalization
                                 Denormalization
SalesOrderId OrderStatus OrderDate PlacedBy               CustomerAccountNumber CreditLimit

20001            Shipped       1/5/2011   Bob Smith 838382                       5000

20002            Fulfillment   5/5/2011 John Doe          291101                 10000

20003            Placed        5/7/2011   Brenda Lee 957588                      7500


                                    Normalization



   17 May 2012                       © 2012 Mark Abramson / @mark__a                     14
Introduction to Database Design / ER Diagrams


                             Getting Fancy
   •   First, second, third-normal form
   •   Generalization
   •   Nonspecific relations
   •   Three-way relationships
   •   Constraints
   •   Referential Integrity actions / triggers
   •   Zachman’s Framework

   17 May 2012                   © 2012 Mark Abramson / @mark__a   15
Introduction to Database Design / ER Diagrams


                                Questions?




   • 1 Exercise
   • Demo
   • Questions + wrap up
   17 May 2012                   © 2012 Mark Abramson / @mark__a   16
Introduction to Database Design / ER Diagrams


                 Exercise! Legacy Baggage




   17 May 2012                   © 2012 Mark Abramson / @mark__a   17
Introduction to Database Design / ER Diagrams


            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
   17 May 2012                   © 2012 Mark Abramson / @mark__a   18
Introduction to Database Design / ER Diagrams


                               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/
   • CA ERWin ($3975)
         – http://erwin.com/products/

   • Tabs Studio ($49)
         – http://www.tabsstudio.com


   17 May 2012                   © 2012 Mark Abramson / @mark__a                  19
Introduction to Database Design / ER Diagrams


                                           Resources
                 Designing Quality Databases With Idef1X                 SQL in a Nutshell: A Desktop Quick Reference
                 Information Models                                      Kevin Kline, Brand Hunt, Daniel Kline
                 Thomas A., M.D. Bruce                                   $18 on Amazon
                 $3.91 on Amazon!



                 The Data Model Resource Book, Vol. 1: A                http://www.databaseanswers.org/data_models
                 Library of Universal Data Models for All               Repository of simple examples of db models
                 Enterprises                                            Free!
                 Len Silverston
                 $45
                 (also check out Vol. 2 and Vol. 3)
                                                                         http://publib.boulder.ibm.com/infocenter/wc
  Image Credits                                                          help/v5r6/index.jsp?topic=/com.ibm.commer
  Slide 1: flickr/besser.jetzt                                           ce.data.doc/refs/rdmindex.htm
  Slide 2: IBM                                                           IBM WebSphere data model
  Slide 3: flickr/Pete Reed                                              Also search for ER Diagrams for other large
  Slide 4: flickr/Artful Magpie                                          systems to see how someone else addressed
                                                                         a set of entities and relationships (MS
  Slide 14: Amazon.com
                                                                         Dynamics, SAP, etc.)
  Slide 15: flickr/Jon Ashcroft
  All ER diagrams: Mark Abramson                                                            www.StackOverflow.com
   17 May 2012                             © 2012 Mark Abramson / @mark__a                                    20
Introduction to Database Design / ER Diagrams


   SQL Server SF Group                                              Red Gate
                Mark Ginnebaugh
                                                                   Edgar Codd




   Attendees
                                    Loving Wife
  Thomas Bruce                                                     Mom + Dad
   17 May 2012                   © 2012 Mark Abramson / @mark__a           21

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019Ahmed Abu Eldahab
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsWebStackAcademy
 
Using runbot to test all your developments automatically
Using runbot to test all your developments automaticallyUsing runbot to test all your developments automatically
Using runbot to test all your developments automaticallyOdoo
 
Building Layouts with CSS
Building Layouts with CSSBuilding Layouts with CSS
Building Layouts with CSSBoris Paillard
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Hermann Hueck
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSHoang Long
 
Reporting with Oracle Application Express (APEX)
Reporting with Oracle Application Express (APEX)Reporting with Oracle Application Express (APEX)
Reporting with Oracle Application Express (APEX)Dimitri Gielis
 
Projeto de sistemas com UML - Parte 1
Projeto de sistemas com UML - Parte 1Projeto de sistemas com UML - Parte 1
Projeto de sistemas com UML - Parte 1Natanael Simões
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 SlidesSuraj Gupta
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafLAY Leangsros
 
Performance optimization for Android
Performance optimization for AndroidPerformance optimization for Android
Performance optimization for AndroidArslan Anwar
 
Azure Machine Learning and ML on Premises
Azure Machine Learning and ML on PremisesAzure Machine Learning and ML on Premises
Azure Machine Learning and ML on PremisesIvo Andreev
 
Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaEdureka!
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to heroAhmed Abu Eldahab
 

Was ist angesagt? (20)

Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
 
Using runbot to test all your developments automatically
Using runbot to test all your developments automaticallyUsing runbot to test all your developments automatically
Using runbot to test all your developments automatically
 
Introduction to Java Scripting
Introduction to Java ScriptingIntroduction to Java Scripting
Introduction to Java Scripting
 
Building Layouts with CSS
Building Layouts with CSSBuilding Layouts with CSS
Building Layouts with CSS
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
 
Flutter
FlutterFlutter
Flutter
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Reporting with Oracle Application Express (APEX)
Reporting with Oracle Application Express (APEX)Reporting with Oracle Application Express (APEX)
Reporting with Oracle Application Express (APEX)
 
Projeto de sistemas com UML - Parte 1
Projeto de sistemas com UML - Parte 1Projeto de sistemas com UML - Parte 1
Projeto de sistemas com UML - Parte 1
 
Building MAUI UI in C#.pptx
Building MAUI UI in C#.pptxBuilding MAUI UI in C#.pptx
Building MAUI UI in C#.pptx
 
Wpf Introduction
Wpf IntroductionWpf Introduction
Wpf Introduction
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and Thymeleaf
 
Performance optimization for Android
Performance optimization for AndroidPerformance optimization for Android
Performance optimization for Android
 
Azure Machine Learning and ML on Premises
Azure Machine Learning and ML on PremisesAzure Machine Learning and ML on Premises
Azure Machine Learning and ML on Premises
 
Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to hero
 

Andere mochten auch

How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
ER Diagrams Simplified
ER Diagrams SimplifiedER Diagrams Simplified
ER Diagrams SimplifiedPuneet Arora
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
When to use composite primary keys
When to use composite primary keysWhen to use composite primary keys
When to use composite primary keysalyssamarieparal
 
How to read a data model
How to read a data modelHow to read a data model
How to read a data modelsanksh
 
Types of Database Models
Types of Database ModelsTypes of Database Models
Types of Database ModelsMurassa Gillani
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbmsNaresh Kumar
 
Network security & cryptography
Network security & cryptographyNetwork security & cryptography
Network security & cryptographyRahulprasad Yadav
 
Entity Relationship Diagram presentation
Entity Relationship Diagram presentationEntity Relationship Diagram presentation
Entity Relationship Diagram presentationSopov Chan
 
Er diagram practical examples
Er diagram practical examplesEr diagram practical examples
Er diagram practical examplesRahul Khanwani
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPTTrinath
 

Andere mochten auch (20)

How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
ER Diagrams Simplified
ER Diagrams SimplifiedER Diagrams Simplified
ER Diagrams Simplified
 
Erd examples
Erd examplesErd examples
Erd examples
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
DFD
DFDDFD
DFD
 
DataBase ch2
DataBase ch2DataBase ch2
DataBase ch2
 
When to use composite primary keys
When to use composite primary keysWhen to use composite primary keys
When to use composite primary keys
 
How to read a data model
How to read a data modelHow to read a data model
How to read a data model
 
Types of Database Models
Types of Database ModelsTypes of Database Models
Types of Database Models
 
enhanced er diagram
enhanced er diagramenhanced er diagram
enhanced er diagram
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
Network security & cryptography
Network security & cryptographyNetwork security & cryptography
Network security & cryptography
 
Entity Relationship Diagram presentation
Entity Relationship Diagram presentationEntity Relationship Diagram presentation
Entity Relationship Diagram presentation
 
Cryptography
CryptographyCryptography
Cryptography
 
Er diagram practical examples
Er diagram practical examplesEr diagram practical examples
Er diagram practical examples
 
Erd practice exercises
Erd practice exercisesErd practice exercises
Erd practice exercises
 
Cryptography
CryptographyCryptography
Cryptography
 
Dbms models
Dbms modelsDbms models
Dbms models
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPT
 

Ähnlich wie Introduction to database design with Idef1X entity relationship (ER) diagrams

Introduction to Database Design with Entity Relationship Diagrams
Introduction to Database Design with Entity Relationship DiagramsIntroduction to Database Design with Entity Relationship Diagrams
Introduction to Database Design with Entity Relationship DiagramsMark A
 
How to build SharePoint applications that everybody loves
How to build SharePoint applications that everybody lovesHow to build SharePoint applications that everybody loves
How to build SharePoint applications that everybody lovesMaarten Visser
 
Data Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph FactoryData Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph FactoryData Con LA
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignJulie Lerman
 
System i - DDL vs DDS Presentation
System i - DDL vs DDS PresentationSystem i - DDL vs DDS Presentation
System i - DDL vs DDS PresentationChuck Walker
 
Unlv user forum_jennifermercer_theraisersedge
Unlv user forum_jennifermercer_theraisersedgeUnlv user forum_jennifermercer_theraisersedge
Unlv user forum_jennifermercer_theraisersedgecarolinestallings
 
What is the difference between Data and Information give an exa
What is the difference between Data and Information give an exaWhat is the difference between Data and Information give an exa
What is the difference between Data and Information give an exavictorring
 
Ibm watson - how it works, and what it means for society beyond winning jeo...
Ibm   watson - how it works, and what it means for society beyond winning jeo...Ibm   watson - how it works, and what it means for society beyond winning jeo...
Ibm watson - how it works, and what it means for society beyond winning jeo...Rick Bouter
 
Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Wooga
 
Getting to Real-Time in a Multi-Model Architecture
Getting to Real-Time in a Multi-Model ArchitectureGetting to Real-Time in a Multi-Model Architecture
Getting to Real-Time in a Multi-Model ArchitectureBenjamin Nussbaum
 
IST365 - Project Deliverable #3Create the corresponding relation.docx
IST365 - Project Deliverable #3Create the corresponding relation.docxIST365 - Project Deliverable #3Create the corresponding relation.docx
IST365 - Project Deliverable #3Create the corresponding relation.docxpriestmanmable
 
DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...
DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...
DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...DATAVERSITY
 
Ads applications of ads
Ads  applications of adsAds  applications of ads
Ads applications of adsTech_MX
 
[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...
[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...
[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...Insight Technology, Inc.
 
Making the leap to BI on Hadoop by Mariani, dave @ atscale
Making the leap to BI on Hadoop by Mariani, dave @ atscaleMaking the leap to BI on Hadoop by Mariani, dave @ atscale
Making the leap to BI on Hadoop by Mariani, dave @ atscaleTin Ho
 

Ähnlich wie Introduction to database design with Idef1X entity relationship (ER) diagrams (20)

Introduction to Database Design with Entity Relationship Diagrams
Introduction to Database Design with Entity Relationship DiagramsIntroduction to Database Design with Entity Relationship Diagrams
Introduction to Database Design with Entity Relationship Diagrams
 
How to build SharePoint applications that everybody loves
How to build SharePoint applications that everybody lovesHow to build SharePoint applications that everybody loves
How to build SharePoint applications that everybody loves
 
Data Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph FactoryData Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph Factory
 
Database Management System-session1-2
Database Management System-session1-2Database Management System-session1-2
Database Management System-session1-2
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
System i - DDL vs DDS Presentation
System i - DDL vs DDS PresentationSystem i - DDL vs DDS Presentation
System i - DDL vs DDS Presentation
 
The "APEX" of database design
The "APEX" of database designThe "APEX" of database design
The "APEX" of database design
 
Unlv user forum_jennifermercer_theraisersedge
Unlv user forum_jennifermercer_theraisersedgeUnlv user forum_jennifermercer_theraisersedge
Unlv user forum_jennifermercer_theraisersedge
 
What is the difference between Data and Information give an exa
What is the difference between Data and Information give an exaWhat is the difference between Data and Information give an exa
What is the difference between Data and Information give an exa
 
IBM Watson-How it works
IBM Watson-How it worksIBM Watson-How it works
IBM Watson-How it works
 
Ibm watson - how it works, and what it means for society beyond winning jeo...
Ibm   watson - how it works, and what it means for society beyond winning jeo...Ibm   watson - how it works, and what it means for society beyond winning jeo...
Ibm watson - how it works, and what it means for society beyond winning jeo...
 
Watson how it works?
Watson how it works?Watson how it works?
Watson how it works?
 
Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)
 
Getting to Real-Time in a Multi-Model Architecture
Getting to Real-Time in a Multi-Model ArchitectureGetting to Real-Time in a Multi-Model Architecture
Getting to Real-Time in a Multi-Model Architecture
 
IST365 - Project Deliverable #3Create the corresponding relation.docx
IST365 - Project Deliverable #3Create the corresponding relation.docxIST365 - Project Deliverable #3Create the corresponding relation.docx
IST365 - Project Deliverable #3Create the corresponding relation.docx
 
DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...
DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...
DataEd Online: Data Architecture and Data Modeling Differences — Achieving a ...
 
Ads applications of ads
Ads  applications of adsAds  applications of ads
Ads applications of ads
 
[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...
[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...
[db tech showcase Tokyo 2018] #dbts2018 #B36 『Design Your Databases straight ...
 
Making the leap to BI on Hadoop by Mariani, dave @ atscale
Making the leap to BI on Hadoop by Mariani, dave @ atscaleMaking the leap to BI on Hadoop by Mariani, dave @ atscale
Making the leap to BI on Hadoop by Mariani, dave @ atscale
 
Entity Framework
Entity FrameworkEntity Framework
Entity Framework
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Introduction to database design with Idef1X entity relationship (ER) diagrams

  • 1. Introduction to Database Design / ER Diagrams Intro to Database Design with Entity-Relationship (ER) Diagrams Mark Abramson, CEO, Forward Thought, Inc. 17 May 2012 © 2012 Mark Abramson / @mark__a 1
  • 2. Introduction to Database Design / ER Diagrams Pop Quiz! 17 May 2012 © 2012 Mark Abramson / @mark__a 2
  • 3. Introduction to Database Design / ER Diagrams THEORY & ELEMENTS DEMO Q&A Edgar F Codd 17 May 2012 © 2012 Mark Abramson / @mark__a 3
  • 4. Introduction to Database Design / ER Diagrams About Me (and disclosures) • Schema-first kind of guy • MS BizSpark Startup Partner • www.bizsparksf.com • Friend of Red Gate • @mark__a • linkedin.com/in/abramsonmark 17 May 2012 © 2012 Mark Abramson / @mark__a 4
  • 5. Introduction to Database Design / ER Diagrams What is a database design? 17 May 2012 © 2012 Mark Abramson / @mark__a 5
  • 6. Introduction to Database Design / ER Diagrams What’s the data look like? SalesOrderId OrderStatus OrderDate PlacedBy IsPriorityOrder CustomerId CurrencyId 20001 Shipped 1/5/2011 Bob Smith 0 3 2 20002 Fulfillment 5/5/2011 John Doe 1 2 2 20003 Placed 5/7/2011 Brenda Lee 0 3 2 CustomerId CustomerName AccountNumber 1 Woolworths 838382 2 Rick's Café 291101 3 Mill Valley Market 957588 17 May 2012 © 2012 Mark Abramson / @mark__a 6
  • 7. Introduction to Database Design / ER Diagrams 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 17 May 2012 © 2012 Mark Abramson / @mark__a 7
  • 8. Introduction to Database Design / ER Diagrams Entity / Relationship Model • An Entity is some “thing” of interest • A Relationship defines the interaction between one or more Entities Contains 17 May 2012 © 2012 Mark Abramson / @mark__a 8
  • 9. Introduction to Database Design / ER Diagrams Entity • Definition • Attributes • Data Types • NULL option • Primary Key • Foreign Key • Identity Columns 17 May 2012 © 2012 Mark Abramson / @mark__a 9
  • 10. Introduction to Database Design / ER Diagrams Relationship • Definition • Identifying • Non-Identifying Non-Identifying Relationship 17 May 2012 © 2012 Mark Abramson / @mark__a 10
  • 11. Introduction to Database Design / ER Diagrams Relationship (2) • Recursive references • Associative / Many-To-Many / “Join Tables” 17 May 2012 © 2012 Mark Abramson / @mark__a 11
  • 12. Introduction to Database Design / ER Diagrams Cardinality • How many instances of each entity may be involved or must be involved? 17 May 2012 © 2012 Mark Abramson / @mark__a 12
  • 13. Introduction to Database Design / ER Diagrams Keys • Primary Keys • Foreign Keys • Candidate Keys • Composite Keys 17 May 2012 © 2012 Mark Abramson / @mark__a 13
  • 14. Introduction to Database Design / ER Diagrams Normalization Denormalization SalesOrderId OrderStatus OrderDate PlacedBy CustomerAccountNumber CreditLimit 20001 Shipped 1/5/2011 Bob Smith 838382 5000 20002 Fulfillment 5/5/2011 John Doe 291101 10000 20003 Placed 5/7/2011 Brenda Lee 957588 7500 Normalization 17 May 2012 © 2012 Mark Abramson / @mark__a 14
  • 15. Introduction to Database Design / ER Diagrams Getting Fancy • First, second, third-normal form • Generalization • Nonspecific relations • Three-way relationships • Constraints • Referential Integrity actions / triggers • Zachman’s Framework 17 May 2012 © 2012 Mark Abramson / @mark__a 15
  • 16. Introduction to Database Design / ER Diagrams Questions? • 1 Exercise • Demo • Questions + wrap up 17 May 2012 © 2012 Mark Abramson / @mark__a 16
  • 17. Introduction to Database Design / ER Diagrams Exercise! Legacy Baggage 17 May 2012 © 2012 Mark Abramson / @mark__a 17
  • 18. Introduction to Database Design / ER Diagrams 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 17 May 2012 © 2012 Mark Abramson / @mark__a 18
  • 19. Introduction to Database Design / ER Diagrams 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/ • CA ERWin ($3975) – http://erwin.com/products/ • Tabs Studio ($49) – http://www.tabsstudio.com 17 May 2012 © 2012 Mark Abramson / @mark__a 19
  • 20. Introduction to Database Design / ER Diagrams Resources Designing Quality Databases With Idef1X SQL in a Nutshell: A Desktop Quick Reference Information Models Kevin Kline, Brand Hunt, Daniel Kline Thomas A., M.D. Bruce $18 on Amazon $3.91 on Amazon! The Data Model Resource Book, Vol. 1: A http://www.databaseanswers.org/data_models Library of Universal Data Models for All Repository of simple examples of db models Enterprises Free! Len Silverston $45 (also check out Vol. 2 and Vol. 3) http://publib.boulder.ibm.com/infocenter/wc Image Credits help/v5r6/index.jsp?topic=/com.ibm.commer Slide 1: flickr/besser.jetzt ce.data.doc/refs/rdmindex.htm Slide 2: IBM IBM WebSphere data model Slide 3: flickr/Pete Reed Also search for ER Diagrams for other large Slide 4: flickr/Artful Magpie systems to see how someone else addressed a set of entities and relationships (MS Slide 14: Amazon.com Dynamics, SAP, etc.) Slide 15: flickr/Jon Ashcroft All ER diagrams: Mark Abramson www.StackOverflow.com 17 May 2012 © 2012 Mark Abramson / @mark__a 20
  • 21. Introduction to Database Design / ER Diagrams SQL Server SF Group Red Gate Mark Ginnebaugh Edgar Codd Attendees Loving Wife Thomas Bruce Mom + Dad 17 May 2012 © 2012 Mark Abramson / @mark__a 21

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 as we go, but write them down + let’s talk about them at the end of the slidesBut if you’re lost and your neighbor has a blank stare, please interrupt
  2. Who are you?------Software engineers?Database engineers? DBAs?Don’t work with anything Microsoft?Why are you here?------Total new to DB?Work with a database that someone else designed?Handed a project and now you’re in charge?Design databases yourself?
  3. 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 diagrams. And know where to look next.There 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
  4. Want you to know of any bias that may affect my talkRun a startup, we make software for wholesalers and manufacturers to scale sales + operationsOn Microsoft stack (SQL Server, MVC, TDD, etc.)Love teaching + learningCheck out upcoming meetings on Agile, PhilHaack! and APIsConnect with me on LinkedInBe one of my 43 followers on Twitter!
  5. 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
  6. CustomerId in SalesOrder table references a record/row in the Customer tableWe can look up / refer to related or seemingly unrelated data elsewhere
  7. C’mon, you have to put all that data *somewhere*!Business Rules? Really? Yes, in *relationships* and other definitionsIt’s a great mental exercise that forces you to think through a lot of hard problemsSeparation of Concerns (1974, check Wikipedia)But what about Agile, TDD and BDD? Yes, in the demo we’ll start simple, break stuff and refactor.
  8. 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
  9. What’s in a name?Naming conventions – singular vs. plural DESCRIBE THE BUSINESSAttribute = property of Entity / Columns of db tableData type choice (decimal vs. float vs. money) varchar vs. nvarchar vs. char vs. textNULL option – is this mandatory per business rules?Primary Key: unique identifier for each row of dataForeign Key: another entity’s PK that is here due to relationshipIDENTITY column: guarantees uniqueness and auto-increments (autonumber). (1,1) specifies the SEED and INCREMENT
  10. A relationship is the “verb” between entities – defines how they interact per business rulesNaming / “writing a sentence” / be consistentDefines 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
  11. Sometimes we end up with complicated relationships and that’s OKRecursive: can ParentId be NULL?Associative / 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
  12. Cardinality: how many instances of each entity may be involved or must be involved?w/ identifying (circle) – there has to be one Customer for some # of Addressw/ non-identifying (diamond) – 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…Enforced via triggers and constraints
  13. 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?
  14. 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
  15. Great opportunities for self-directed learningGeneralization:Account  Savings Account, Checking Account, Mortgage AccountCascading deletesIn sum, there are a lot of database rules that can protect your data from you! Developer actions, etc.
  16. 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?
  17. Features + benefits of these as you go up/down the food chain