--- id: sql-select title: "SQL Select" category: "Database" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["SQL SELECT Statement", "SELECT statement", "SQL 쑰회"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.92 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["sql", "database", "w3schools", "select", "query"] raw_sources: ["https://www.w3schools.com/sql/sql_select.asp"] applied_in: [] github_commit: "" --- # [[SQL Select]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The SELECT statement retrieves data from a database β€” name specific columns to select a subset, or use `*` to select every column of a table. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **SELECT statement** β€” used to select data from a database; the result is stored in a result table (the "result-set"). [S1] - **SELECT syntax** β€” `SELECT column1, column2, ... FROM table_name;` where `column1, column2, ...` are the columns to retrieve and `table_name` is the source table. [S1] - **SELECT \*** β€” selects ALL columns of a table without naming each one individually. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Explicit column list vs. wildcard** β€” naming exact columns (`SELECT CustomerName, City FROM Customers;`) is more precise and efficient than `SELECT * FROM Customers;`, which returns every column. [S1] ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) | ν•­λͺ© (Option) | μž₯점 | 단점 | μ–Έμ œ 선택 | |---|---|---|---| | **컬럼 λͺ…μ‹œ (`SELECT col1, col2`)** | ν•„μš”ν•œ λ°μ΄ν„°λ§Œ 가져와 νŠΈλž˜ν”½/처리 λΉ„μš© 절감, μ˜λ„κ°€ λͺ…확함 | 컬럼이 μΆ”κ°€/변경될 λ•Œ 쿼리λ₯Ό μˆ˜μ •ν•΄μ•Ό 함 | ν”„λ‘œλ•μ…˜ 쿼리, ν•„μš”ν•œ 컬럼이 λͺ…ν™•ν•  λ•Œ | | **μ™€μΌλ“œμΉ΄λ“œ (`SELECT *`)** | μž‘μ„±μ΄ λΉ λ₯΄κ³  λͺ¨λ“  μ»¬λŸΌμ„ μ¦‰μ‹œ 확인 κ°€λŠ₯ | λΆˆν•„μš”ν•œ 데이터 전솑, ν…Œμ΄λΈ” ꡬ쑰 변경에 μ·¨μ•½ | 탐색적 쑰회, μž„μ‹œ 디버깅 | ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Return specific columns from the Customers table: [S1] ```sql SELECT CustomerName, City FROM Customers; ``` - Select every column from the Customers table: [S1] ```sql SELECT * FROM Customers; ``` - The demo Customers table used throughout the tutorial has columns `CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” SELECT 문은 이후 WHERE/ORDER BY/JOIN λ“± 거의 λͺ¨λ“  SQL νŠœν† λ¦¬μ–Ό μ±•ν„°μ˜ 기반 λ¬Έλ²•μœΌλ‘œ μž¬μ‚¬μš©λœλ‹€. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Select specific columns (SQL): ```sql SELECT CustomerName, City FROM Customers; ``` Select all columns (SQL): ```sql SELECT * FROM Customers; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.92 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[SQL Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[SQL Syntax]], [[SQL Where]], [[SQL Select Distinct]], [[SQL Order By]] - **μ°Έμ‘° λ§₯락:** 데이터 쑰회의 κ°€μž₯ 기본이 λ˜λŠ” λ¬Έμ„œ β€” WHERE/JOIN/GROUP BY λ“± 이후 λͺ¨λ“  쑰회 κ΄€λ ¨ μ±•ν„°μ˜ 좜발점. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” SQL SELECT Statement β€” https://www.w3schools.com/sql/sql_select.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "SQL SELECT Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).