Sample Exam Questions
Execute 'DELETE * FROM test;'.
Execute 'DELETE ALL FROM test;'.
Execute 'DELETE FROM test;'.
Execute 'DROP ROWS FROM test;'.
You can also execute 'TRUNCATE test;', which is faster.
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/10
To delete data from a table, use the DELETE statement. The basic syntax is:
DELETE FROM table_name WHERE condition_expression
Rows for which the result of evaluating the condition expression is true are deleted. If the WHERE clause is omitted, all rows in the table are deleted. If the transaction feature is enabled, you can revert with ROLLBACK, but if not, you may lose all data unexpectedly, so please be very careful when executing.
While DELETE scans the table and deletes data even without a WHERE clause, TRUNCATE releases the data area of the table without scanning the table, allowing the table to be emptied more quickly.
Options A, B, and D are all incorrect in terms of SQL syntax.
Therefore, the correct answers are C and E.
© EDUCO All Rights Reserved.