[{"data":1,"prerenderedAt":121},["ShallowReactive",2],{"term-j\u002Fjoin":3,"related-j\u002Fjoin":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\u002Fj\u002Fjoin.md","JOIN",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",{},"JOIN combines rows from two tables based on a related column. If you want to see order details AND the customer name in one result, you JOIN the orders table and the users table together. It is like merging two spreadsheets on a shared column.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"A JOIN combines rows from two or more tables based on a related column condition. The most common type is INNER JOIN (only matching rows). Variants include LEFT JOIN, RIGHT JOIN, and FULL JOIN. JOINs are fundamental to querying normalized relational data.",[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","SELECT users.name, orders.total\nFROM orders\nJOIN users ON orders.user_id = users.id\nWHERE orders.status = 'completed';\n","sql","",[38,39,40,48,54,60],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"SELECT users.name, orders.total\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"FROM orders\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"JOIN users ON orders.user_id = users.id\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},"WHERE orders.status = 'completed';\n",[11,67,69],{"id":68},"when-youll-hear-this","When You'll Hear This",[16,71,72],{},"\"JOIN the users and orders tables to get the customer name with each order.\" \u002F \"Multiple JOINs on large tables can be slow without indexes.\"",[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","JOIN combines rows from two tables based on a related column.","intermediate","md","j",{},true,"\u002Fterms\u002Fj\u002Fjoin",[92,93,94,95,96],"INNER JOIN","LEFT JOIN","RIGHT JOIN","FULL JOIN","Foreign Key",{"title":5,"description":84},{"changefreq":99,"priority":100},"weekly",0.7,"terms\u002Fj\u002Fjoin","9gLp5PdHq9XxIL4YyVK2I5xTC0P4cp3aJN_ZwYxR_OQ",[104,108,112,115,118],{"title":96,"path":105,"acronym":6,"category":83,"difficulty":106,"description":107},"\u002Fterms\u002Ff\u002Fforeign-key","beginner","A foreign key is how you link two tables together. If an 'orders' table has a 'user_id' column pointing to the 'users' table, that is a foreign key.",{"title":95,"path":109,"acronym":6,"category":83,"difficulty":110,"description":111},"\u002Fterms\u002Ff\u002Ffull-join","advanced","FULL JOIN returns everything from both tables regardless of whether there is a match. Rows with no match on either side get NULLs.",{"title":92,"path":113,"acronym":6,"category":83,"difficulty":85,"description":114},"\u002Fterms\u002Fi\u002Finner-join","INNER JOIN only returns rows where there is a match in BOTH tables. If a user has no orders, they do not appear in the result.",{"title":93,"path":116,"acronym":6,"category":83,"difficulty":85,"description":117},"\u002Fterms\u002Fl\u002Fleft-join","LEFT JOIN returns all rows from the left table, and matching rows from the right table.",{"title":94,"path":119,"acronym":6,"category":83,"difficulty":85,"description":120},"\u002Fterms\u002Fr\u002Fright-join","RIGHT JOIN is LEFT JOIN's mirror image — it returns all rows from the right table, and matching rows from the left.",1776518289648]