{"id":44,"date":"2009-01-21T18:12:00","date_gmt":"2009-01-21T18:12:00","guid":{"rendered":"https:\/\/karwin.com\/blog\/index.php\/2009\/01\/21\/understanding-unfamiliar-databases\/"},"modified":"2009-01-21T18:12:00","modified_gmt":"2009-01-21T18:12:00","slug":"understanding-unfamiliar-databases","status":"publish","type":"post","link":"https:\/\/karwin.com\/blog\/index.php\/2009\/01\/21\/understanding-unfamiliar-databases\/","title":{"rendered":"Understanding Unfamiliar Databases"},"content":{"rendered":"<p>A user recently <a href=\"http:\/\/stackoverflow.com\/questions\/278430\/what-are-the-best-ways-to-understand-an-unfamiliar-database\">asked<\/a>:<\/p>\n<div>\n<blockquote><p>What kind of approaches and techniques can you employ to become familiar with an existing database if you are tasked with supporting and\/or modifying it? How can you easily and effectively ramp up your knowledge of a database you have never seen before?<\/p><\/blockquote>\n<p>Here was my reply:<\/p>\n<div>\n<ul>\n<li>\n<p>The first thing I do is create an <a style=\"font-weight: bold;\" href=\"http:\/\/en.wikipedia.org\/wiki\/Entity-relationship_model\" rel=\"nofollow\">Entity-Relationship Diagram<\/a> (ERD). Sometimes you can simply describe the metadata with command-line tools but to save time there are some tools that can generate a diagram automatically.<\/p>\n<\/li>\n<li>\n<p>Second, examine each <span style=\"font-weight: bold;\">table<\/span> and <span style=\"font-weight: bold;\">column<\/span> make sure I learn the meaning of what it stores.<\/p>\n<\/li>\n<li>\n<p>Third, examine each <span style=\"font-weight: bold;\">relationship<\/span> and make sure I understand how the tables relate to one another.<\/p>\n<\/li>\n<li>\n<p>Fourth, read any <span style=\"font-weight: bold;\">views<\/span> or <span style=\"font-weight: bold;\">triggers<\/span> to understand custom data integrity enforcement or cascading operations.<\/p>\n<\/li>\n<li>\n<p>Fifth, read any <span style=\"font-weight: bold;\">stored procedures<\/span>.  Also read SQL access privileges if there are such.<\/p>\n<\/li>\n<li>\n<p>Sixth, read through parts of the <span style=\"font-weight: bold;\">application code<\/span> that use the database. That&#8217;s where some additional business rules and data integrity rules are enforced.<\/p>\n<\/li>\n<\/ul><\/div>\n<\/p><\/div>\n<p>I&#8217;m posting to my blog the questions I&#8217;ve answered on StackOverflow, which earned the &#8220;Good Answer&#8221; badge. This was my answer to &#8220;<a href=\"http:\/\/stackoverflow.com\/questions\/278430\/what-are-the-best-ways-to-understand-an-unfamiliar-database#278458\">What are the Best Ways to Understand an Unfamiliar Database?<\/a>&#8220;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A user recently asked: What kind of approaches and techniques can you employ to become familiar with an existing database if you are tasked with supporting and\/or modifying it? How can you easily and effectively ramp up your knowledge of a database you have never seen before? Here was my reply: The first thing I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[10,30],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-best-practices","category-database"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pawgV7-I","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":0,"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/karwin.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}