2
Reading the OCA Oracle Database SQL Exam Guide(1Z0-071
) I came across the following definition for the TRUNCATE
on the topic of DDL(Data Definition Language):
Removes all the Rows-in other words, data-from an existing table in the database. TRUNCATE is Something of a Brute-force Alternative to the DELETE statement, in that TRUNCATE gives up Recovery options offered by DELETE in exchange for Faster performance. These Differences in approach are the Reason TRUNCATE is categorized as DDL while DELETE is DML.
Translation via Google Translator:
Remove all rows - in other words, data - from a table existing in the database. TRUNCATE is a kind of brute force alternative to the DELETE declaration, where TRUNCATE gives up options Recovery offered by DELETE in exchange for faster performance. These differences of approach are the TRUNCATE ratio is categorized as DDL, while DELETE is DML.
Reading this, I became more attentive when the subject involved DDL and something related to data removal, since the TRUNCATE
is connected to this.
At the end of the chapter, in the question session, I found the following question:
Describe the Purpose of DDL
10- What is one of the purposes of DDL? (Choose the best answer.)
A. Query data from a given table
B. Issue privileges to users
C. Remove existing data from a database table
D. None of the above
My answer was the alternative B
(for having to choose the best answer), but for me the alternative C
was also correct (taking into account the first section highlighted in the question) and, when viewing the answers, were the following explanations:
B. The GRANT statement is part of DDL and is used to Issue privileges to a user.
To, C, and D are incorrect. Querying data is performed using the DML statement SELECT. Use the DML statements UPDATE or DELETE to remove data from a database table. UPDATE can be used to remove data from one or more Columns in a Given Row, and DELETE can be used to remove an entire Row. "None of the above" does not apply Since option B is correct.
Translation via Google Translator:
B. GRANT instruction is part of the DDL and is used to issue privileges for a user.
To, C and D are incorrect. The data is performed using the SELECT DML instruction. Use the DML instructions UPDATE or DELETE to remove data from a database table. UPDATE can be used to remove data from one or more columns in one given line, and DELETE can be used to remove a line integer. "None of the above" does not apply as option B is correct.
- The alternative
C
really is incorrect? - It would be a mistake of the author to claim that the alternative
C
is incorrect? - If the question were multiple choices, I might consider it correct?
GRANT
andREVOKE
has more to do with DCL (data control language) than with DDL. At least in the traditional and abstract world of SQL out of a engine specific. But some people say thatSELECT
not DML, but DQL... each invents the terms you want and uses it however you want...– Jefferson Quesado
this book is the official right? I am seeing with some friends about their opinion... for me the answer would not be B.... as Jefferson said, it is DCL... With the definition of truncate, my interpretation is that the correct answer would be C.
– Melanie Ribeiro