--- id: sql-not title: "SQL Not" category: "Database" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["SQL NOT Operator", "NOT 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", "not", "operators", "where"] raw_sources: ["https://www.w3schools.com/sql/sql_not.asp"] applied_in: [] github_commit: "" --- # [[SQL Not]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The NOT operator reverses a WHERE condition's truth value, and combines with LIKE, BETWEEN, IN, IS NULL, and comparison operators to express exclusion. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **NOT operator** β€” returns records that do NOT match the specified criteria, reversing a condition from true to false and vice versa. [S1] - **Syntax** β€” `SELECT ... FROM table_name WHERE NOT condition;`. [S1] - **Common NOT combinations** β€” `NOT LIKE`, `NOT BETWEEN`, `NOT IN`, `IS NOT NULL`, `NOT EXISTS`. [S1] - **NOT with comparisons** β€” "not greater than" and "not less than" are expressed as `WHERE NOT column > value` / `WHERE NOT column < value`, rather than dedicated operators. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Negate-by-wrapping** β€” rather than a distinct exclusion operator per case, SQL wraps `NOT` around an existing predicate (`=`, `LIKE`, `BETWEEN`, `IN`, comparison), giving a single uniform negation mechanism. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Basic negated equality: `SELECT * FROM Customers WHERE NOT Country = 'Spain';`. [S1] - NOT LIKE: `WHERE CustomerName NOT LIKE 'A%';` excludes names starting with "A". [S1] - NOT BETWEEN: `WHERE CustomerID NOT BETWEEN 10 AND 60;` selects rows outside the inclusive range. [S1] - NOT IN: `WHERE City NOT IN ('Paris', 'London');` excludes rows matching any listed value. [S1] - NOT with comparison: `WHERE NOT CustomerID > 50;` (not greater than) and `WHERE NOT CustomerId < 50;` (not less than). [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” NOT은 LIKE/BETWEEN/IN 챕터 κ°κ°μ—μ„œ λ°˜λŒ€ 쑰건을 ν‘œν˜„ν•˜λŠ” 곡톡 λ„κ΅¬λ‘œ μž¬μ‚¬μš©λœλ‹€. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Basic NOT (SQL): ```sql SELECT * FROM Customers WHERE NOT Country = 'Spain'; ``` NOT combined with IN (SQL): ```sql SELECT * FROM Customers WHERE City NOT IN ('Paris', 'London'); ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** 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 Or]], [[SQL Like]], [[SQL Between]], [[SQL In]] - **μ°Έμ‘° λ§₯락:** WHERE 절 쑰건을 λ°˜μ „μ‹œμΌœμ•Ό ν•  λ•Œ 항상 μž¬μ‚¬μš©λ˜λŠ” λ²”μš© λΆ€μ • μ—°μ‚°μž. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” SQL NOT Operator β€” https://www.w3schools.com/sql/sql_not.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "SQL NOT Operator" page (Astra wiki-curation, P-Reinforce v3.1 format).