e9cbf23ab5
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
3.9 KiB
3.9 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-select-into | SQL Select Into | Database | draft | conceptual |
|
B | 0.88 | 2026-07-04 | 2026-07-04 |
|
|
SQL Select Into
🎯 한 줄 통찰 (One-line insight)
SELECT INTO creates a brand-new table populated from an existing one — useful for backups or ad-hoc analysis tables — but does not carry over primary keys, indexes, or NOT NULL constraints. [S1]
🧠 핵심 개념 (Core concepts)
- SELECT INTO statement — creates a new table and fills it with data from an existing table. [S1]
- Constraint loss — the new table gets the same column names/types as the source, but NOT primary keys, indexes, or NOT NULL constraints. [S1]
- Syntax (full copy) —
SELECT * INTO newtable [IN external_db] FROM sourcetable WHERE condition;. [S1] - Syntax (partial copy) —
SELECT column1, column2, ... INTO newtable [IN external_db] FROM sourcetable WHERE condition;. [S1]
🧩 추출된 패턴 (Extracted patterns)
- Empty-schema-clone trick —
SELECT * INTO newtable FROM sourcetable WHERE 1 = 0;creates a new, empty table with the source's schema, by using a condition that structurally can never be true. [S1] - Multi-table copy — SELECT INTO can source from a JOIN across multiple tables, not just a single table. [S1]
📖 세부 내용 (Details)
- Full backup copy:
SELECT * INTO CustomersBackup2026 FROM Customers;. [S1] - Backup into another database:
SELECT * INTO CustomersBackup2026 IN 'Backup.mdb' FROM Customers;. [S1] - Copy specific columns only:
SELECT CustomerName, ContactName INTO Customers2 FROM Customers;. [S1] - Copy a filtered subset:
SELECT * INTO US_Customers FROM Customers WHERE Country = 'USA';. [S1] - Copy from a JOIN:
SELECT Customers.CustomerName, Orders.OrderID INTO CustomersOrder FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID;. [S1] - Empty schema-only clone:
SELECT * INTO newtable FROM sourcetable WHERE 1 = 0;. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음. 다만 새 테이블이 원본의 제약조건(PK/인덱스/NOT NULL)을 물려받지 않는다는 한계가 명시적으로 언급됨. [S1]
🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 백업 테이블 생성, 분석용 임시 테이블 생성에 전형적으로 쓰인다. [S1]
💻 코드 패턴 (Code patterns)
Backup copy of a table (SQL):
SELECT * INTO CustomersBackup2026
FROM Customers;
Schema-only empty clone (SQL):
SELECT * INTO newtable
FROM sourcetable
WHERE 1 = 0;
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.88
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: SQL Tutorial
- 관련 개념: SQL Insert Into Select, SQL Create Table, SQL Left Join
- 참조 맥락: 새 테이블을 만들며 데이터를 채워야 할 때 사용 — 기존 테이블에 데이터만 옮기려면 대신 INSERT INTO SELECT를 사용.
📚 출처 (Sources)
- [S1] W3Schools — SQL SELECT INTO Statement — https://www.w3schools.com/sql/sql_select_into.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "SQL SELECT INTO Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).