<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Juhi Singhal</title>
    <description>The latest articles on DEV Community by Juhi Singhal (@juhi_singhal_7d7fb8634472).</description>
    <link>https://dev.to/juhi_singhal_7d7fb8634472</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3994405%2F309da3a7-c0e9-4d54-88c7-1fd1042e2b27.jpg</url>
      <title>DEV Community: Juhi Singhal</title>
      <link>https://dev.to/juhi_singhal_7d7fb8634472</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juhi_singhal_7d7fb8634472"/>
    <language>en</language>
    <item>
      <title>DBMS &amp; SQL Cheat Sheet You Need for Tech Interviews in 2026</title>
      <dc:creator>Juhi Singhal</dc:creator>
      <pubDate>Sun, 21 Jun 2026 10:43:33 +0000</pubDate>
      <link>https://dev.to/juhi_singhal_7d7fb8634472/dbms-sql-cheat-sheet-you-need-for-tech-interviews-in-2026-1l92</link>
      <guid>https://dev.to/juhi_singhal_7d7fb8634472/dbms-sql-cheat-sheet-you-need-for-tech-interviews-in-2026-1l92</guid>
      <description>&lt;h1&gt;
  
  
  The Only DBMS &amp;amp; SQL Cheat Sheet You Need for Tech Interviews in 2026
&lt;/h1&gt;

&lt;p&gt;Whether you're a CS student preparing for campus placements or a working professional switching to a product company — DBMS and SQL questions will show up in your interview. Every time.&lt;/p&gt;

&lt;p&gt;The problem? Most resources are either 500-page textbooks or scattered blog posts that take hours to piece together.&lt;/p&gt;

&lt;p&gt;This article covers every DBMS and SQL concept that actually gets asked in technical interviews — concise, structured, and straight to the point.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why DBMS Still Gets Asked in 2026
&lt;/h2&gt;

&lt;p&gt;Interviewers at companies like Google, Amazon, Microsoft, and mid-size product companies ask DBMS because it tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How well you understand data at a fundamental level&lt;/li&gt;
&lt;li&gt;Whether you can design scalable systems&lt;/li&gt;
&lt;li&gt;If you can write efficient SQL under pressure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Skipping DBMS prep is one of the most common reasons candidates fail technical rounds.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. ER Diagrams — The Foundation
&lt;/h2&gt;

&lt;p&gt;An Entity Relationship diagram shows the logical structure of a database before it's built.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3 things interviewers check:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can you identify entities, attributes, and relationships?&lt;/li&gt;
&lt;li&gt;Do you know strong vs weak entity sets?&lt;/li&gt;
&lt;li&gt;Can you map cardinality correctly (1:1, 1:N, M:N)?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common interview question:&lt;/strong&gt; &lt;em&gt;"Design an ER diagram for a hospital management system."&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Keys — Always Asked, Often Confused
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key Type&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Primary Key&lt;/td&gt;
&lt;td&gt;Uniquely identifies each row, cannot be NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Candidate Key&lt;/td&gt;
&lt;td&gt;Minimal set of attributes that can be primary key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Foreign Key&lt;/td&gt;
&lt;td&gt;References primary key of another table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Composite Key&lt;/td&gt;
&lt;td&gt;Primary key made of multiple columns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unique Key&lt;/td&gt;
&lt;td&gt;Unique but can have one NULL value&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Super Key&lt;/td&gt;
&lt;td&gt;Any set of attributes that uniquely identifies a row&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Most asked question:&lt;/strong&gt; &lt;em&gt;"What is the difference between Primary Key and Unique Key?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Answer: Primary Key cannot be NULL. Unique Key can have one NULL.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Normalization — The #1 DBMS Interview Topic
&lt;/h2&gt;

&lt;p&gt;Normalization removes redundancy and ensures data integrity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1NF&lt;/strong&gt; — Every cell must have a single atomic value. No repeating groups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2NF&lt;/strong&gt; — Must be in 1NF + no partial dependency. Every non-prime attribute must depend on the whole primary key, not part of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3NF&lt;/strong&gt; — Must be in 2NF + no transitive dependency. Non-prime attributes should not depend on other non-prime attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BCNF&lt;/strong&gt; — Stricter than 3NF. For every functional dependency A→B, A must be a superkey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most asked question:&lt;/strong&gt; &lt;em&gt;"What is the difference between 3NF and BCNF?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Answer: In 3NF, a non-prime attribute can determine another non-prime attribute if the determinant is a candidate key. BCNF removes even that exception.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. ACID Properties — Memorize This Cold
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;What It Guarantees&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Atomicity&lt;/td&gt;
&lt;td&gt;Transaction completes fully or not at all&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consistency&lt;/td&gt;
&lt;td&gt;Database stays valid before and after transaction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Isolation&lt;/td&gt;
&lt;td&gt;Concurrent transactions don't interfere with each other&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Durability&lt;/td&gt;
&lt;td&gt;Committed data persists even after system failure&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Real-world example interviewers love:&lt;/strong&gt; Bank transfer — if debit succeeds but credit fails, Atomicity ensures the entire transaction rolls back.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Transaction States
&lt;/h2&gt;

&lt;p&gt;Active → Partially Committed → Committed → Terminated&lt;/p&gt;

&lt;p&gt;If failure occurs: Active/Partially Committed → Failed → Aborted&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Schedules &amp;amp; Serializability
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Serial Schedule&lt;/strong&gt; — Transactions execute one after another. Always consistent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-Serial Schedule&lt;/strong&gt; — Transactions execute concurrently. Not always consistent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serializable Schedule&lt;/strong&gt; — A non-serial schedule that produces the same result as some serial schedule. This is what databases aim for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conflict Serializable — can be converted to serial by swapping non-conflicting operations&lt;/li&gt;
&lt;li&gt;View Serializable — produces same final state as a serial schedule&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. SQL — The Practical Part
&lt;/h2&gt;

&lt;h3&gt;
  
  
  DDL vs DML vs DCL vs TCL
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Commands&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DDL&lt;/td&gt;
&lt;td&gt;CREATE, ALTER, DROP, TRUNCATE, RENAME&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DML&lt;/td&gt;
&lt;td&gt;SELECT, INSERT, UPDATE, DELETE, MERGE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DCL&lt;/td&gt;
&lt;td&gt;GRANT, REVOKE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TCL&lt;/td&gt;
&lt;td&gt;COMMIT, ROLLBACK, SAVEPOINT&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  JOINs — Always in Interviews
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- INNER JOIN: Only matching rows from both tables&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;
&lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- LEFT JOIN: All rows from left table + matching from right&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;
&lt;span class="k"&gt;LEFT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- FULL OUTER JOIN: All rows from both tables&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;
&lt;span class="k"&gt;FULL&lt;/span&gt; &lt;span class="k"&gt;OUTER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  GROUP BY vs HAVING
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- WHERE filters rows BEFORE grouping&lt;/span&gt;
&lt;span class="c1"&gt;-- HAVING filters AFTER grouping&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;Country&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;Country&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s1"&gt;'USA'&lt;/span&gt;          &lt;span class="c1"&gt;-- filters before group&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;Country&lt;/span&gt;
&lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- filters after group&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Most asked question:&lt;/strong&gt; &lt;em&gt;"What is the difference between WHERE and HAVING?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Answer: WHERE filters individual rows before aggregation. HAVING filters grouped results after aggregation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Aggregate Functions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; 
  &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ProductID&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;   &lt;span class="c1"&gt;-- number of rows&lt;/span&gt;
  &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;         &lt;span class="c1"&gt;-- total&lt;/span&gt;
  &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;         &lt;span class="c1"&gt;-- average&lt;/span&gt;
  &lt;span class="k"&gt;MIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;         &lt;span class="c1"&gt;-- smallest&lt;/span&gt;
  &lt;span class="k"&gt;MAX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;-- largest&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  8. Relational Algebra — For Theory Rounds
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;σ (Selection)&lt;/td&gt;
&lt;td&gt;Filter rows based on condition&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;∏ (Projection)&lt;/td&gt;
&lt;td&gt;Select specific columns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⋈ (Natural Join)&lt;/td&gt;
&lt;td&gt;Join on common attributes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;− (Minus)&lt;/td&gt;
&lt;td&gt;Rows in R1 but not in R2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;∪ (Union)&lt;/td&gt;
&lt;td&gt;Rows in either R1 or R2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  9. Indexing, B-Trees &amp;amp; B+ Trees
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Primary Index&lt;/strong&gt; — Built on ordered key field. Speeds up search significantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B-Tree&lt;/strong&gt; — Every node (including internal nodes) stores data pointers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B+ Tree&lt;/strong&gt; — Only leaf nodes store data. Internal nodes store only keys. This makes B+ Trees faster for range queries and is why most modern databases (MySQL, PostgreSQL) use B+ Trees internally.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Most Candidates Miss
&lt;/h2&gt;

&lt;p&gt;Most candidates can define ACID. Few can explain &lt;em&gt;why&lt;/em&gt; Isolation is hard to achieve in concurrent systems, or &lt;em&gt;when&lt;/em&gt; BCNF decomposition causes dependency loss.&lt;/p&gt;

&lt;p&gt;The difference between candidates who clear interviews and those who don't is depth — understanding the &lt;em&gt;why&lt;/em&gt; behind each concept, not just the definition.&lt;/p&gt;




&lt;h2&gt;
  
  
  Want All of This in One Place?
&lt;/h2&gt;

&lt;p&gt;I compiled everything covered in this article — plus transaction state diagrams, full SQL syntax reference, all JOIN types with examples, and normalization rules — into a clean &lt;strong&gt;27-page PDF&lt;/strong&gt; built specifically for placement and technical interview prep.&lt;/p&gt;

&lt;p&gt;No fluff. Just the concepts, diagrams, and SQL examples that show up in real interviews.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://juhisngl.gumroad.com/l/vkoos" rel="noopener noreferrer"&gt;Get the DBMS &amp;amp; SQL Interview Preparation Notes – $5.99&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instant download. Used by CS students and working professionals preparing for product company interviews.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this helped you, drop a comment with which topic you find hardest in DBMS — I'll cover it in detail in the next post.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>computerscience</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
