liveBook · Manning

Drop table statement

As explained in ScyllaDB in Action

A DROP TABLE statement removes a table and all of its stored rows from a database schema.

DROP TABLE permanently removes a table and every row stored in it. Unlike TRUNCATE, which clears rows but leaves the table ready for use, dropping also removes the table’s structure. section 6.2.4

After a table is dropped, inserts and updates cannot use it until you re-create the table. This makes DROP TABLE useful for obsolete tables or local test work that is finished. section 6.2.4

Treat DROP TABLE as a high-risk operation:

  • Confirm that removing both the data and table structure is intended. section 6.2.4
  • Test the operation in a testing environment before production use. section 6.2.4
  • Ensure that nothing is accessing the table you plan to remove. section 6.2.4

How ScyllaDB in Action covers it

How deep it goes
Defines DROP TABLE by contrasting it with TRUNCATE and explains the need to re-create the removed table.
Examples
Uses article_summaries_by_date as a test table for clearing data, then identifies a temporary table for trying DROP TABLE.
What it assumes
Assumes familiarity with tables and basic data writes while defining the difference between clearing and removing a table.
What you can do after
Operate/configure it by deciding when full table removal is appropriate and checking its production impact first.
How it connects
Connects DROP TABLE to TRUNCATE, DROP KEYSPACE, INSERT, UPDATE, and table re-creation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.