1cfd3bbb56
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고, Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
3.7 KiB
3.7 KiB
id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
| id | title | category | status | verification_status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | created_at | updated_at | review_reason | merge_history | tags | raw_sources | applied_in | github_commit | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sql-insert-into-select | SQL Insert Into Select | Database | draft | conceptual |
|
B | 0.88 | 2026-07-04 | 2026-07-04 |
|
|
SQL Insert Into Select
🎯 한 줄 통찰 (One-line insight)
INSERT INTO SELECT copies rows from one existing table into another EXISTING table, leaving the target's current rows untouched — unlike SELECT INTO, which creates a brand-new table. [S1]
🧠 핵심 개념 (Core concepts)
- INSERT INTO SELECT statement — copies data from an existing table and inserts it into another existing table. [S1]
- Data type matching required — source and target table column data types must match. [S1]
- Target rows preserved — existing records in the target table are unaffected by the insert. [S1]
- Syntax (all columns) —
INSERT INTO target_table SELECT * FROM source_table WHERE condition;— requires column count/order to match exactly if names are omitted. [S1] - Syntax (specific columns) —
INSERT INTO target_table (column1, column2, ...) SELECT column1, column2, ... FROM source_table WHERE condition;. [S1]
🧩 추출된 패턴 (Extracted patterns)
- Partial-column copy leaves NULLs — copying only some target columns (e.g.
CustomerName, City, Country) leaves the unmapped target columns as NULL for the inserted rows. [S1] - Filtered source-to-target copy — a WHERE clause on the source SELECT restricts which rows get copied (e.g. only German suppliers). [S1]
📖 세부 내용 (Details)
- Copy specific columns from Suppliers into Customers:
INSERT INTO Customers (CustomerName, City, Country) SELECT SupplierName, City, Country FROM Suppliers;. [S1] - Copy all columns (requires matching schema):
INSERT INTO Customers SELECT * FROM Suppliers;. [S1] - Copy a filtered subset:
INSERT INTO Customers (CustomerName, City, Country) SELECT SupplierName, City, Country FROM Suppliers WHERE Country='Germany';. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — SELECT INTO(새 테이블 생성)와 대비되는, 기존 테이블 간 데이터 이관에 쓰이는 문서다. [S1]
💻 코드 패턴 (Code patterns)
Copy filtered rows between existing tables (SQL):
INSERT INTO Customers (CustomerName, City, Country)
SELECT SupplierName, City, Country FROM Suppliers
WHERE Country='Germany';
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.88
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: SQL Tutorial
- 관련 개념: SQL Select Into, SQL Insert Into, SQL Where
- 참조 맥락: 기존 테이블 간 데이터 이관 시 사용 — 새 테이블을 만들어야 한다면 대신 SELECT INTO를 사용.
📚 출처 (Sources)
- [S1] W3Schools — SQL INSERT INTO SELECT Statement — https://www.w3schools.com/sql/sql_insert_into_select.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "SQL INSERT INTO SELECT Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).