Sample Exam Questions
An error occurs because the SQL syntax is wrong.
Although it is recognized as a data deletion SQL command, nothing is deleted because there are no rows that match the WHERE clause.
A prompt asking whether to delete the data is displayed.
All rows in the table 'table_name' are deleted and the table becomes empty.
The table 'table_name' is dropped.
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/02
The standard form of the DELETE statement is:
DELETE FROM table_name WHERE condition_expression
However, it's easier to understand if you think of the rows that would be displayed when executing:
SELECT * FROM table_name WHERE condition_expression
as the rows that would be deleted when the DELETE statement is executed.
The DELETE statement in the example does not have a WHERE clause, but this is not a problem in terms of SQL syntax.
When you execute 'SELECT * FROM table_name', all the rows that exist in the specified table are displayed. Therefore, when you execute 'DELETE FROM table_name', all rows in the table are deleted. Although it might be helpful to have a warning or confirmation dialog for such a dangerous command, SQL does not provide such a feature.
Therefore, the correct answer is D.
Note: If you really want to empty a table, using TRUNCATE is faster than using DELETE.
© EDUCO All Rights Reserved.