Files
2nd/10_Wiki/Dev/Topic_SQL/SQL_Drop_Table.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.6 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-drop-table SQL Drop Table Database draft conceptual
SQL DROP TABLE Statement
DROP TABLE
TRUNCATE TABLE
SQL 테이블 삭제
B 0.9 2026-07-04 2026-07-04
sql
database
w3schools
droptable
truncate
https://www.w3schools.com/sql/sql_drop_table.asp

SQL Drop Table

🎯 한 줄 통찰 (One-line insight)

DROP TABLE permanently removes a table and all its content, blocked if another table's foreign key still references it — while TRUNCATE TABLE clears all rows but keeps the table structure intact. [S1]

🧠 핵심 개념 (Core concepts)

  • DROP TABLE statement — permanently deletes an existing table and all its content. [S1]
  • SyntaxDROP TABLE table_name;, or safely DROP TABLE IF EXISTS table_name;. [S1]
  • Foreign key blocking — most databases refuse to drop a table still referenced by a foreign key constraint elsewhere; the constraint or dependent table must be removed first. [S1]
  • TRUNCATE TABLE — deletes all records in a table while keeping the table structure, columns, and constraints. [S1]

⚖️ 비교 및 선택 기준 (Comparison & decision criteria)

항목 (Option) 장점 단점 언제 선택
DROP TABLE 테이블과 데이터를 완전히 제거 되돌릴 수 없고 구조도 사라짐, FK 참조 시 실패 테이블 자체가 더 이상 필요 없을 때
TRUNCATE TABLE 구조·제약조건 유지하며 데이터만 빠르게 비움 개별 행 조건 삭제는 불가(전체 삭제만) 구조는 재사용하되 데이터만 초기화할 때

📖 세부 내용 (Details)

  • Safe drop with existence check: DROP TABLE IF EXISTS Shippers;. [S1]
  • Truncate (empty but keep structure): TRUNCATE TABLE table_name;. [S1]
  • FK constraint blocking: dropping a table referenced by another table's FOREIGN KEY requires removing the constraint or the dependent table first. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

소스에서 모순되는 정보는 발견되지 않음.

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — SQL Delete 챕터에서 DROP TABLE이 이미 "행 삭제(DELETE)와 다르다"는 맥락으로 먼저 언급되었고, 여기서 IF EXISTS/FK 차단/TRUNCATE로 확장된다. [S1]

💻 코드 패턴 (Code patterns)

Safe drop and truncate (SQL):

DROP TABLE IF EXISTS Shippers;
TRUNCATE TABLE table_name;

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.90
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

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