[{"data":1,"prerenderedAt":120},["ShallowReactive",2],{"term-u\u002Fupdate":3,"related-u\u002Fupdate":103},{"id":4,"title":5,"acronym":6,"body":7,"category":83,"description":84,"difficulty":85,"extension":86,"letter":87,"meta":88,"navigation":89,"path":90,"related":91,"seo":97,"sitemap":98,"stem":101,"subcategory":6,"__hash__":102},"terms\u002Fterms\u002Fu\u002Fupdate.md","UPDATE",null,{"type":8,"value":9,"toc":77},"minimark",[10,15,19,23,26,30,66,70,73],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"UPDATE changes existing data in a table. It is the 'Update' in CRUD. ALWAYS use a WHERE clause with it — if you forget, you update every single row in the table. That is a bad day.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"UPDATE is the SQL statement for modifying existing rows in a table. It sets new values for specified columns. A WHERE clause filters which rows are updated — without it, all rows in the table are modified. It triggers constraint checks and any relevant triggers.",[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","-- ALWAYS use WHERE or you update ALL rows\nUPDATE users\nSET email = 'newemail@example.com'\nWHERE id = 42;\n","sql","",[38,39,40,48,54,60],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"-- ALWAYS use WHERE or you update ALL rows\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"UPDATE users\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"SET email = 'newemail@example.com'\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},"WHERE id = 42;\n",[11,67,69],{"id":68},"when-youll-hear-this","When You'll Hear This",[16,71,72],{},"\"UPDATE the user's profile when they save changes.\" \u002F \"I accidentally ran UPDATE without WHERE and updated 50,000 rows.\"",[74,75,76],"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":78},[79,80,81,82],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":68,"depth":50,"text":69},"database","UPDATE changes existing data in a table. It is the 'Update' in CRUD.","beginner","md","u",{},true,"\u002Fterms\u002Fu\u002Fupdate",[92,93,94,95,96],"SELECT","INSERT","DELETE","WHERE","CRUD",{"title":5,"description":84},{"changefreq":99,"priority":100},"weekly",0.7,"terms\u002Fu\u002Fupdate","vBGdCNeLecjFzUTY6coZxC6KpUOE_Hy-Nf3hc3SZyXA",[104,108,111,114,117],{"title":96,"path":105,"acronym":106,"category":83,"difficulty":85,"description":107},"\u002Fterms\u002Fc\u002Fcrud","Create, Read, Update, Delete","CRUD is the four things you can do to data: Create it, Read it, Update it, Delete it. Literally every app ever made is just CRUD in a trenchcoat.",{"title":94,"path":109,"acronym":6,"category":83,"difficulty":85,"description":110},"\u002Fterms\u002Fd\u002Fdelete","DELETE removes rows from a table. It is the 'Delete' in CRUD. Like UPDATE, you MUST use a WHERE clause — without it, you delete everything in the table.",{"title":93,"path":112,"acronym":6,"category":83,"difficulty":85,"description":113},"\u002Fterms\u002Fi\u002Finsert","INSERT is how you add new data to a database. It is the 'Create' in CRUD. You tell it which table, which columns, and what values to put in.",{"title":92,"path":115,"acronym":6,"category":83,"difficulty":85,"description":116},"\u002Fterms\u002Fs\u002Fselect","SELECT is how you ask a database to give you data. It is the 'Read' in CRUD.",{"title":95,"path":118,"acronym":6,"category":83,"difficulty":85,"description":119},"\u002Fterms\u002Fw\u002Fwhere","WHERE is how you filter which rows a query affects. Without WHERE, SELECT returns everything, UPDATE changes everything, DELETE deletes everything.",1776518320818]