Files
2nd/10_Wiki/Dev/Topic_SQL/SQL_Select_Into.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

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
SQL SELECT INTO Statement
SELECT INTO
SQL 테이블 복사
B 0.88 2026-07-04 2026-07-04
sql
database
w3schools
selectinto
backup
https://www.w3schools.com/sql/sql_select_into.asp

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 trickSELECT * 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)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "SQL SELECT INTO Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).