[{"data":1,"prerenderedAt":141},["ShallowReactive",2],{"term-a\u002Fauto-increment":3,"related-a\u002Fauto-increment":129},{"id":4,"title":5,"acronym":6,"body":7,"category":112,"description":113,"difficulty":114,"extension":115,"letter":116,"meta":117,"navigation":71,"path":118,"related":119,"seo":123,"sitemap":124,"stem":127,"subcategory":6,"__hash__":128},"terms\u002Fterms\u002Fa\u002Fauto-increment.md","Auto Increment",null,{"type":8,"value":9,"toc":106},"minimark",[10,15,19,23,26,30,95,99,102],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"Auto increment means the database assigns the next ID number automatically every time you insert a row. You insert user #1, #2, #3 without ever thinking about it. No need to track 'what was the last ID' yourself.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"Auto increment is a column property (SERIAL or IDENTITY in PostgreSQL, AUTO_INCREMENT in MySQL) that generates a unique, sequential integer value for each new row. It is the most common implementation for surrogate primary keys. The sequence is managed by the database engine.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","-- PostgreSQL (SERIAL)\nCREATE TABLE users (\n  id SERIAL PRIMARY KEY  -- 1, 2, 3...\n);\n\n-- MySQL\nCREATE TABLE users (\n  id INT AUTO_INCREMENT PRIMARY KEY\n);\n","sql","",[38,39,40,48,54,60,66,73,79,84,90],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"-- PostgreSQL (SERIAL)\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"CREATE TABLE users (\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"  id SERIAL PRIMARY KEY  -- 1, 2, 3...\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},");\n",[41,67,69],{"class":43,"line":68},5,[41,70,72],{"emptyLinePlaceholder":71},true,"\n",[41,74,76],{"class":43,"line":75},6,[41,77,78],{},"-- MySQL\n",[41,80,82],{"class":43,"line":81},7,[41,83,53],{},[41,85,87],{"class":43,"line":86},8,[41,88,89],{},"  id INT AUTO_INCREMENT PRIMARY KEY\n",[41,91,93],{"class":43,"line":92},9,[41,94,65],{},[11,96,98],{"id":97},"when-youll-hear-this","When You'll Hear This",[16,100,101],{},"\"The id column auto-increments so you never have to set it manually.\" \u002F \"Gaps in auto-increment IDs are normal — don't worry about them.\"",[103,104,105],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":107},[108,109,110,111],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":97,"depth":50,"text":98},"database","Auto increment means the database assigns the next ID number automatically every time you insert a row.","beginner","md","a",{},"\u002Fterms\u002Fa\u002Fauto-increment",[120,121,122],"Primary Key","UUID","Default Value",{"title":5,"description":113},{"changefreq":125,"priority":126},"weekly",0.7,"terms\u002Fa\u002Fauto-increment","JSp2YxWcnpCs1igpgbcOgfcSyCON-L70aJNF-nKhQOA",[130,133,136],{"title":122,"path":131,"acronym":6,"category":112,"difficulty":114,"description":132},"\u002Fterms\u002Fd\u002Fdefault-value","A default value is what gets stored in a column when you do not provide one.",{"title":120,"path":134,"acronym":6,"category":112,"difficulty":114,"description":135},"\u002Fterms\u002Fp\u002Fprimary-key","A primary key is the unique ID that every row in a table must have. Like a social security number for your data — no two rows can have the same one.",{"title":121,"path":137,"acronym":138,"category":112,"difficulty":139,"description":140},"\u002Fterms\u002Fu\u002Fuuid","Universally Unique Identifier","intermediate","A UUID is a randomly generated ID that looks like 'a3b4c5d6-...' and is practically guaranteed to be unique across the entire universe.",1776518256799]