SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Último

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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 

Último (20)

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
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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)
 

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

Notas do Editor

  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