--- id: sql-or title: "SQL Or" category: "Database" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["SQL OR Operator", "OR operator", "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", "or", "operators", "where"] raw_sources: ["https://www.w3schools.com/sql/sql_or.asp"] applied_in: [] github_commit: "" --- # [[SQL Or]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The OR operator filters records so that a row is returned if ANY of the chained conditions in the WHERE clause is true. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **OR operator** β€” combines multiple conditions in a WHERE clause; a record is returned if at least one condition is TRUE. [S1] - **Syntax** β€” `SELECT ... FROM table_name WHERE condition1 OR condition2 OR condition3 ...;`. [S1] - **AND vs. OR** β€” OR requires only one condition true, whereas AND requires all conditions true. [S1] - **Combining AND and OR** β€” mixing the two requires parentheses to control evaluation grouping. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Multi-condition OR chain** β€” three or more OR'd conditions (`City = 'Berlin' OR CustomerName LIKE 'G%' OR Country = 'Norway'`) generalize cleanly beyond a simple two-value check. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Filter on two alternative values: `SELECT * FROM Customers WHERE Country = 'Germany' OR Country = 'Spain';`. [S1] - Filter on three OR'd conditions: `WHERE City = 'Berlin' OR CustomerName LIKE 'G%' OR Country = 'Norway';`. [S1] - Mixed AND/OR needs parentheses for the intended grouping (see [[SQL And]] for the worked example). [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” SQL IN μ—°μ‚°μžκ°€ 동일 μ»¬λŸΌμ— λŒ€ν•œ 닀쀑 OR 쑰건의 μΆ•μ•½ν˜•μœΌλ‘œ 이후 μ±•ν„°μ—μ„œ μ†Œκ°œλœλ‹€. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) OR across two values (SQL): ```sql SELECT * FROM Customers WHERE Country = 'Germany' OR Country = 'Spain'; ``` OR across three conditions (SQL): ```sql SELECT * FROM Customers WHERE City = 'Berlin' OR CustomerName LIKE 'G%' OR Country = 'Norway'; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[SQL Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[SQL Where]], [[SQL And]], [[SQL In]] - **μ°Έμ‘° λ§₯락:** WHERE 절 닀쀑 쑰건 κ²°ν•©μ˜ κΈ°λ³Έ μ—°μ‚°μž β€” AND/NOTκ³Ό μ„ΈνŠΈλ‘œ 이해해야 ν•˜λ©°, IN μ—°μ‚°μžλ‘œ μΆ•μ•½ κ°€λŠ₯. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” SQL OR Operator β€” https://www.w3schools.com/sql/sql_or.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "SQL OR Operator" page (Astra wiki-curation, P-Reinforce v3.1 format).