<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Database Design Book</title>
    <link>https://anchorsandlinks.com/</link>
    <description>Recent content on Database Design Book</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 06 Sep 2026 20:00:00 +0100</lastBuildDate>
    <atom:link href="https://anchorsandlinks.com/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ID design and primary keys, pt. 2</title>
      <link>https://anchorsandlinks.com/posts/primary-keys-2/</link>
      <pubDate>Sun, 06 Sep 2026 20:00:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/primary-keys-2/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;, &lt;em&gt;(~2200 words)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;a href=&#34;https://anchorsandlinks.com/posts/primary-keys/&#34;&gt;first part&lt;/a&gt; we introduced a strict separation between logical and physical aspects around IDs and primary keys.&lt;/p&gt;&#xA;&lt;p&gt;We discussed the logical concepts of external IDs and anchor IDs, and the physical concept of a primary key.&lt;/p&gt;&#xA;&lt;p&gt;There are four main data elements: &lt;strong&gt;anchors&lt;/strong&gt;, &lt;strong&gt;attributes&lt;/strong&gt;, &lt;strong&gt;links&lt;/strong&gt;, and &lt;strong&gt;secondary data&lt;/strong&gt;.  Every database is modeled using a combination of those elements.  Elements map to physical tables, and each physical table needs a primary key.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ID design and primary keys, pt. 1</title>
      <link>https://anchorsandlinks.com/posts/primary-keys/</link>
      <pubDate>Fri, 21 Aug 2026 20:00:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/primary-keys/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;, &lt;em&gt;(~2300 words)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is the first part of a systematic discussion of primary keys in database design. As usual, we present the material in a way that deviates from the traditional approach.&lt;/p&gt;&#xA;&lt;p&gt;This is basically a bonus chapter from the “&lt;a href=&#34;https://databasedesignbook.com/&#34;&gt;Database Design Book&lt;/a&gt;”. The goal of this text is to teach you how to design your primary keys based on business requirements.&lt;/p&gt;&#xA;&lt;p&gt;In &lt;strong&gt;part 1&lt;/strong&gt;, we begin at the logical level.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ERD diagrams, pt. II: physical diagrams</title>
      <link>https://anchorsandlinks.com/posts/erd-diagrams-2/</link>
      <pubDate>Mon, 25 Aug 2025 22:30:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/erd-diagrams-2/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;a href=&#34;https://anchorsandlinks.com/posts/erd-diagrams/&#34;&gt;first part&lt;/a&gt; we’ve designed a logical ERD diagram based on the structured logical model.  We built the structured logical model from the free-text business requirements.&lt;/p&gt;&#xA;&lt;p&gt;What if we need to draw &lt;strong&gt;a physical ERD diagram&lt;/strong&gt; for the same task?  It turns out that we’ve already done maybe 80% of the work, and we can reuse the structured logical model verbatim.  We’ll just use a different graphical notation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ERD diagrams, pt. I: many-to-many relationships</title>
      <link>https://anchorsandlinks.com/posts/erd-diagrams/</link>
      <pubDate>Fri, 25 Jul 2025 22:30:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/erd-diagrams/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I started writing a long post on how to design correct ERD diagrams based on the approach from the &lt;a href=&#34;https://databasedesignbook.com/&#34;&gt;“Database Design Book”&lt;/a&gt;, but the text got a bit unwieldy.  So I’m going to regroup and focus on one part: many-to-many relationships (“M:N links” in book terms).&lt;/p&gt;&#xA;&lt;p&gt;Suppose that you need to build an ERD diagram based on some sort of real-world or teaching task.  How do you make sure that your ERD diagram is correct?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Systematic design of multi-join GROUP BY queries</title>
      <link>https://anchorsandlinks.com/posts/systematic-design-of-join-queries/</link>
      <pubDate>Thu, 22 May 2025 22:30:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/systematic-design-of-join-queries/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;, ~5400 words.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This is the first public revision of this text.  Early readers have&#xA;shared encouraging feedback, but I’m sure there’s still room for&#xA;improvement. I’m releasing it now to gather broader input from a&#xA;wider audience.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update (2025-06-08)&lt;/strong&gt;: I wrote a prequel to this text: &amp;ldquo;Multi-join&#xA;queries design: investigation&amp;rdquo;.&#xA;&lt;a href=&#34;https://minimalmodeling.substack.com/p/multi-join-queries-design-investigation&#34;&gt;https://minimalmodeling.substack.com/p/multi-join-queries-design-investigation&lt;/a&gt;, another 3400 words.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update (2026-01-25)&lt;/strong&gt;: Here is another prequel: &amp;ldquo;A modern guide to&#xA;SQL JOINs&amp;rdquo; (~8800 words).  This one builds the foundation to&#xA;systematically build queries based on JOINs.&#xA;&lt;a href=&#34;https://kb.databasedesignbook.com/posts/sql-joins/&#34;&gt;https://kb.databasedesignbook.com/posts/sql-joins/&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Historized attributes: systematic table design</title>
      <link>https://anchorsandlinks.com/posts/historized-attributes-design/</link>
      <pubDate>Sat, 09 Nov 2024 14:00:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/historized-attributes-design/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;(Word count: 3200)&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A common problem in business-oriented database design: &lt;strong&gt;keeping the history of values of a certain data attribute&lt;/strong&gt;.  For example, we may want to track the price of various goods, as they change with time.  Many other tasks could be reduced to this problem: for example, when people change their address in the government database, we may want to keep track of previous addresses.&lt;/p&gt;&#xA;&lt;p&gt;TL;DR: A solution is presented below, in the “Final SQL schema” section.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Many yes/no attributes: table design study</title>
      <link>https://anchorsandlinks.com/posts/restaurant-attributes-design/</link>
      <pubDate>Thu, 20 Jun 2024 00:13:00 +0100</pubDate>
      <guid>https://anchorsandlinks.com/posts/restaurant-attributes-design/</guid>
      <description>&lt;p&gt;Author: Alexey Makhotkin &lt;a href=&#34;mailto:squadette@gmail.com&#34;&gt;squadette@gmail.com&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I wanted to demonstrate the relationship between the logical model and a physical model. We’re going to design a commonly seen use case: many yes/no attributes of a single anchor (in our case, Restaurant).  Then we’ll discuss how the physical tables would be designed.  We’ll see that sometimes physical design strategy changes as the system becomes more mature.  At the same time, logical design elements never change if the business requirement is still relevant.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
