SlideShare a Scribd company logo
How to document a database
Piotr Kononow
Dataedo
https://dataedo.com
Agenda
I. Why document
II. What is database documentation
III. How to document
I. WHY
DOCUMENT
Need to data access & analysis is growing
Google search
https://dataedo.com
Databases are vague
Sample table and column names from real databases:
• MTL_SYSTEM_ITEMS_B – Raw materials?
• tP – Projects. Who would guess…
• BEN_PRTT_RMT_RQST_CTFN_PRVDD - ?
• RSRCSECX - ?
• ATTRIBUTE5 – Who knows…
https://dataedo.com
Databases are complex
Sample table in Oracle e-Business Suite (ERP)
https://dataedo.com
Databases are large
Number of tables and views in sample applications:
• Sample custom enterprise application: 3,000
• TETA (HRM): 9,000
• Oracle e-Business Suite (ERP): 55,000
• SAP (ERP): 130,000!
https://dataedo.com
…but as if addresses had following format:
PA_ADW_R_ACT_CMT_B_V.TXN_ADW_NOTIFY_FLAG
Finding a column is like trying to find an apartment in Manhattan
You need a map
https://dataedo.com
When is it useful?
• Software Development
• Data Warehousing, BI
• Data Analysis, Data Science, Big Bata
• Packaged application implementation – ERP, CRM, HRM,
billing etc.
• Application Integration (EAI, EII, MDM)
• Software/system maintenance
• Data Migration
• Data Quality
• Master Data Management
https://dataedo.com
II. WHAT IS
DATABASE DOCUMENTATION
1. Data Dictionary
Table: employee
Table holds past, current and future company employees.
Column Data type Description
BusinessEntityID int Primary key for Employee records. Foreign key
to BusinessEntity.BusinessEntityID.
NationalIDNumber nvarchar(15) Unique national identification number such as
a social security number.
LoginID nvarchar(256) Network login.
OrganizationNode hierarchyid Where the employee is located in corporate
hierarchy.
OrganizationLevel smallint The depth of the employee in the corporate
hierarchy.
JobTitle nvarchar(50) Work title such as Buyer or Sales
Representative.
https://dataedo.com
Relations
https://dataedo.com
Table Role Foreign key column Description
Departments Works in DepartmentID Department where emplyee
People Manager ManagerID Employee superior
JobsDict Job title TitleID Employee job title
Statuses
Employee row can be in following statuses based on dates:
• Future – start_date > today or start_date null
• Current – start_date <= today and (end_date > today or null)
• Past – end_date < today
https://dataedo.com
List of Values
Column Description
MaritalStatus M = Married, S = Single, NULL = Unknown
ActiveFlag 1 = Active, 0 = Inactive
https://dataedo.com
Data Access Interface
To modify and fetch data use this:
• employee_get – returns specified employee row
• employees_get – returns selected employees
• employee_insert – use this to insert new employee
• employee_update – use this to update employee row
• employee_delete – use this to delete employee
https://dataedo.com
Usage
View: employees_active_v
Used by: Employees search form,
Active employees report
https://dataedo.com
Data Source
Table: employee
Data source: Employees form, sync_employees
Column Source
MaritalStatus Employees form
NationalIDNumber Employees form
Number emp_no trigger
Score Data warehouse, calc_employees_scores
https://dataedo.com
Other Metadata
Table: po_headers_all (Purchase orders)
Subject Area: Purchasing
Owner: Piotr Kononow
Column
po_header_id
po_header_number [OBSOLETE]
po_header_code
qty Quantity
value qty * unit_price
https://dataedo.com
Meaningful Descriptions
Instead of this:
Column Description
number Invoice number
date Invoice date
https://dataedo.com
Meaningful Descriptions
Do this:
Column Description
number Invoice autogenerated number, starting from 1 each
year. Number is generated when invoice gets
approved.
date Invoice issue date. Null for working copy invoices. Set
to today’s date on invoice approval.
https://dataedo.com
2. ERDs – The Good
https://dataedo.com
ERDs – The Bad
https://dataedo.com
ERD is not this:
https://dataedo.com
But this:
https://dataedo.com
3. Document Code
https://dataedo.com
Metadata, Change History
https://dataedo.com
III. HOW TO
DOCUMENT
Rule of thumb:
Document as you design and develop
https://dataedo.com
What tools to use?
• MS Excel, MS Word, Notepad
• Database console
• Dedicated tool
https://dataedo.com
Database console – Description
Not most convenient
https://dataedo.com
Dedicated tools
• Dataedo
• Redgate SQL Doc
• ApexSQL Doc
https://dataedo.com
Dedicated tools
https://dataedo.com
Dedicated tools
https://dataedo.com
Thank you
Piotr Kononow
Learn more at:
https://dataedo.com/blog

More Related Content

PPTX
How to build a data dictionary
PPTX
PPTX
5. stored procedure and functions
PPT
1. Introduction to DBMS
ODP
Ms sql-server
PPT
Fundamentals of Database ppt ch02
PPT
Database systems introduction
PPTX
Sql Functions And Procedures
How to build a data dictionary
5. stored procedure and functions
1. Introduction to DBMS
Ms sql-server
Fundamentals of Database ppt ch02
Database systems introduction
Sql Functions And Procedures

What's hot (20)

DOCX
Uml diagram for_hospital_management_system
PPT
OODM-object oriented data model
PPTX
Blood Bank Management System
DOCX
373512722-Employee-Leave-Management-System.docx
PPTX
Namespaces in C#
PPTX
SQL Server Reporting Services
PPTX
PPT FOR ONLINE HOTEL MANAGEMENT
PDF
Database System Concepts and Architecture
PPT
PPTX
SQL commands
PPTX
Sql - Structured Query Language
PPTX
Data warehouse design
PPTX
Rdbms
PDF
Data warehouse architecture
PPTX
MongoDB
PPTX
Assemblies
DOCX
Pharmacy management system Requirement Analysis and Elicitation Document
PDF
Micro project list dms- 22319
Uml diagram for_hospital_management_system
OODM-object oriented data model
Blood Bank Management System
373512722-Employee-Leave-Management-System.docx
Namespaces in C#
SQL Server Reporting Services
PPT FOR ONLINE HOTEL MANAGEMENT
Database System Concepts and Architecture
SQL commands
Sql - Structured Query Language
Data warehouse design
Rdbms
Data warehouse architecture
MongoDB
Assemblies
Pharmacy management system Requirement Analysis and Elicitation Document
Micro project list dms- 22319
Ad

Viewers also liked (19)

PPTX
Clean Code (Presentacion interna en Virtual Software)
PDF
SQL- Data Base
PPTX
Names, Things, and Open Identifier Infrastructure: N2T and ARKs
PDF
How to find and fix your Oracle-based application performance problem
PDF
Oracle 12c New Features_RMAN_slides
PDF
DBA oracle
PPTX
А.Левенчук -- киберэкспертиза: мифы и реальность
PPTX
Scaling etl with hadoop shapira 3
PPTX
DBA Commands and Concepts That Every Developer Should Know
PPTX
Scaling ETL with Hadoop - Avoiding Failure
PDF
Clase 7-Conceptos hebraicos-davar-parte-iii
PDF
A Walk Through the Kimball ETL Subsystems with Oracle Data Integration
PPTX
Designing High Performance ETL for Data Warehouse
PDF
ETL Is Dead, Long-live Streams
PDF
Infographie Slack : 5 raisons de remplacer votre messagerie interne
PDF
Paraloka darsanamulu
PPTX
It consultant in usa-subrat patnaik.
PDF
Customer Engagement for Trailblazers
PPTX
Backup & recovery with rman
Clean Code (Presentacion interna en Virtual Software)
SQL- Data Base
Names, Things, and Open Identifier Infrastructure: N2T and ARKs
How to find and fix your Oracle-based application performance problem
Oracle 12c New Features_RMAN_slides
DBA oracle
А.Левенчук -- киберэкспертиза: мифы и реальность
Scaling etl with hadoop shapira 3
DBA Commands and Concepts That Every Developer Should Know
Scaling ETL with Hadoop - Avoiding Failure
Clase 7-Conceptos hebraicos-davar-parte-iii
A Walk Through the Kimball ETL Subsystems with Oracle Data Integration
Designing High Performance ETL for Data Warehouse
ETL Is Dead, Long-live Streams
Infographie Slack : 5 raisons de remplacer votre messagerie interne
Paraloka darsanamulu
It consultant in usa-subrat patnaik.
Customer Engagement for Trailblazers
Backup & recovery with rman
Ad

Similar to How to document a database (20)

PPT
ITReady DW Day2
PPT
MSBI and Data WareHouse techniques by Quontra
PPTX
project_phrase I.pptx
PPT
Creating Database 2010
PPTX
Advance Sql Server Store procedure Presentation
PPT
3._DWH_Architecture__Components.ppt
PPTX
What is a Database?
PPTX
DataModeling.pptx
PPTX
53 SQL Questions-Answers12121212121212.pptx
PPTX
53 SQL Questions-Answers=53 SQL Questions-Answers
PPT
Basics of Microsoft Business Intelligence and Data Integration Techniques
PDF
MIS5101 WK10 Outcome Measures
PPTX
ETL
PDF
Data warehousing and business intelligence project report
PPTX
Data Modeling, Meta Data and Data Lineage Demo - Highlights from 2016 Data Mo...
DOCX
Business Intelligence
PPTX
Revamp the tablespace reorg process with ibm db2 automation tool
PPTX
How to Fire People with SharePoint
PPTX
BI Apps Architecture
ITReady DW Day2
MSBI and Data WareHouse techniques by Quontra
project_phrase I.pptx
Creating Database 2010
Advance Sql Server Store procedure Presentation
3._DWH_Architecture__Components.ppt
What is a Database?
DataModeling.pptx
53 SQL Questions-Answers12121212121212.pptx
53 SQL Questions-Answers=53 SQL Questions-Answers
Basics of Microsoft Business Intelligence and Data Integration Techniques
MIS5101 WK10 Outcome Measures
ETL
Data warehousing and business intelligence project report
Data Modeling, Meta Data and Data Lineage Demo - Highlights from 2016 Data Mo...
Business Intelligence
Revamp the tablespace reorg process with ibm db2 automation tool
How to Fire People with SharePoint
BI Apps Architecture

Recently uploaded (20)

PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Introduction to Artificial Intelligence
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
ai tools demonstartion for schools and inter college
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Digital Strategies for Manufacturing Companies
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
medical staffing services at VALiNTRY
How Creative Agencies Leverage Project Management Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Operating system designcfffgfgggggggvggggggggg
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Introduction to Artificial Intelligence
Softaken Excel to vCard Converter Software.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
PTS Company Brochure 2025 (1).pdf.......
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms II-SECS-1021-03
How to Migrate SBCGlobal Email to Yahoo Easily
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Which alternative to Crystal Reports is best for small or large businesses.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
CHAPTER 2 - PM Management and IT Context
Digital Strategies for Manufacturing Companies
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How to Choose the Right IT Partner for Your Business in Malaysia
medical staffing services at VALiNTRY

How to document a database

  • 1. How to document a database Piotr Kononow Dataedo https://dataedo.com
  • 2. Agenda I. Why document II. What is database documentation III. How to document
  • 4. Need to data access & analysis is growing Google search https://dataedo.com
  • 5. Databases are vague Sample table and column names from real databases: • MTL_SYSTEM_ITEMS_B – Raw materials? • tP – Projects. Who would guess… • BEN_PRTT_RMT_RQST_CTFN_PRVDD - ? • RSRCSECX - ? • ATTRIBUTE5 – Who knows… https://dataedo.com
  • 6. Databases are complex Sample table in Oracle e-Business Suite (ERP) https://dataedo.com
  • 7. Databases are large Number of tables and views in sample applications: • Sample custom enterprise application: 3,000 • TETA (HRM): 9,000 • Oracle e-Business Suite (ERP): 55,000 • SAP (ERP): 130,000! https://dataedo.com
  • 8. …but as if addresses had following format: PA_ADW_R_ACT_CMT_B_V.TXN_ADW_NOTIFY_FLAG Finding a column is like trying to find an apartment in Manhattan
  • 9. You need a map https://dataedo.com
  • 10. When is it useful? • Software Development • Data Warehousing, BI • Data Analysis, Data Science, Big Bata • Packaged application implementation – ERP, CRM, HRM, billing etc. • Application Integration (EAI, EII, MDM) • Software/system maintenance • Data Migration • Data Quality • Master Data Management https://dataedo.com
  • 11. II. WHAT IS DATABASE DOCUMENTATION
  • 12. 1. Data Dictionary Table: employee Table holds past, current and future company employees. Column Data type Description BusinessEntityID int Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID. NationalIDNumber nvarchar(15) Unique national identification number such as a social security number. LoginID nvarchar(256) Network login. OrganizationNode hierarchyid Where the employee is located in corporate hierarchy. OrganizationLevel smallint The depth of the employee in the corporate hierarchy. JobTitle nvarchar(50) Work title such as Buyer or Sales Representative. https://dataedo.com
  • 13. Relations https://dataedo.com Table Role Foreign key column Description Departments Works in DepartmentID Department where emplyee People Manager ManagerID Employee superior JobsDict Job title TitleID Employee job title
  • 14. Statuses Employee row can be in following statuses based on dates: • Future – start_date > today or start_date null • Current – start_date <= today and (end_date > today or null) • Past – end_date < today https://dataedo.com
  • 15. List of Values Column Description MaritalStatus M = Married, S = Single, NULL = Unknown ActiveFlag 1 = Active, 0 = Inactive https://dataedo.com
  • 16. Data Access Interface To modify and fetch data use this: • employee_get – returns specified employee row • employees_get – returns selected employees • employee_insert – use this to insert new employee • employee_update – use this to update employee row • employee_delete – use this to delete employee https://dataedo.com
  • 17. Usage View: employees_active_v Used by: Employees search form, Active employees report https://dataedo.com
  • 18. Data Source Table: employee Data source: Employees form, sync_employees Column Source MaritalStatus Employees form NationalIDNumber Employees form Number emp_no trigger Score Data warehouse, calc_employees_scores https://dataedo.com
  • 19. Other Metadata Table: po_headers_all (Purchase orders) Subject Area: Purchasing Owner: Piotr Kononow Column po_header_id po_header_number [OBSOLETE] po_header_code qty Quantity value qty * unit_price https://dataedo.com
  • 20. Meaningful Descriptions Instead of this: Column Description number Invoice number date Invoice date https://dataedo.com
  • 21. Meaningful Descriptions Do this: Column Description number Invoice autogenerated number, starting from 1 each year. Number is generated when invoice gets approved. date Invoice issue date. Null for working copy invoices. Set to today’s date on invoice approval. https://dataedo.com
  • 22. 2. ERDs – The Good https://dataedo.com
  • 23. ERDs – The Bad https://dataedo.com
  • 24. ERD is not this: https://dataedo.com
  • 29. Rule of thumb: Document as you design and develop https://dataedo.com
  • 30. What tools to use? • MS Excel, MS Word, Notepad • Database console • Dedicated tool https://dataedo.com
  • 31. Database console – Description Not most convenient https://dataedo.com
  • 32. Dedicated tools • Dataedo • Redgate SQL Doc • ApexSQL Doc https://dataedo.com
  • 35. Thank you Piotr Kononow Learn more at: https://dataedo.com/blog