--- id: sql-joins title: "SQL Joins" category: "Database" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["SQL JOIN Clause", "SQL 쑰인"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["sql", "database", "w3schools", "join"] raw_sources: ["https://www.w3schools.com/sql/sql_join.asp"] applied_in: [] github_commit: "" --- # [[SQL Joins]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) JOIN combines rows from two or more tables based on a related column between them, with four variants (INNER/LEFT/RIGHT/FULL) differing in which unmatched rows they keep. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **JOIN clause** β€” combines rows from two or more tables based on a related column. [S1] - **(INNER) JOIN** β€” returns only rows with matching values in both tables. [S1] - **LEFT (OUTER) JOIN** β€” returns all rows from the left table, plus matched rows from the right table. [S1] - **RIGHT (OUTER) JOIN** β€” returns all rows from the right table, plus matched rows from the left table. [S1] - **FULL (OUTER) JOIN** β€” returns all rows when there is a match in either table. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Related-column identification** β€” before writing a JOIN, identify the shared column between two tables (e.g. `CustomerID` appears in both "Orders" and "Customers"). [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Example relationship: the "Orders" table's `CustomerID` refers to the "Customers" table's `CustomerID`. [S1] - INNER JOIN combining the two: `SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate FROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;`. [S1] - The four JOIN types are summarized as covering: matches-only (INNER), left-preserving (LEFT), right-preserving (RIGHT), and both-preserving (FULL). [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” 이 λ¬Έμ„œλŠ” 개둠이며, 각 JOIN μœ ν˜•μ€ μ΄μ–΄μ§€λŠ” κ°œλ³„ 챕터(Inner/Left/Right/Full/Self Join)μ—μ„œ μƒμ„Ένžˆ 닀뀄진닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Basic INNER JOIN (SQL): ```sql SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate FROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[SQL Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[SQL Inner Join]], [[SQL Left Join]], [[SQL Right Join]], [[SQL Full Join]], [[SQL Aliases]] - **μ°Έμ‘° λ§₯락:** JOIN 계열 챕터 μ „μ²΄μ˜ 개둠 β€” 이후 4κ°€μ§€ JOIN μœ ν˜•μ΄ 각각 별도 λ¬Έμ„œλ‘œ μ‹¬ν™”λœλ‹€. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” SQL Joins β€” https://www.w3schools.com/sql/sql_join.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "SQL Joins" page (Astra wiki-curation, P-Reinforce v3.1 format).