Sobes.tech
Middle

Which query can be used to delete all records from a table (clear it): - DROP TABLE table_name; - DELETE TABLE table_name; - DELETE FROM table_name; - WIPE TABLE table_name; - No correct answer

sobes.tech AI

Answer from AI

The correct query to delete all records from a table is:

DELETE FROM table_name;

Explanation:

  • DROP TABLE table_name; — deletes the entire table along with its data and structure.
  • DELETE TABLE table_name; — is syntactically incorrect.
  • WIPE TABLE table_name; — no such SQL query exists.

If you need to quickly clear a table, you can also use TRUNCATE TABLE table_name;, which deletes all records and usually works faster, but this option is not provided in the question.

Which query can be used to delete all records from a… - sobes.tech