Which three statements are true about single row functions?
Options:
A.
They can be used only in the where clause of a select statement.
B.
They can accept only one argument.
C.
They return a single result row per table.
D.
The argument can be a column name, variable, literal or an expression.
E.
They can be nested to any level.
F.
The date type returned can be different from the data type of the argument.
Answer:
D, E, F
Explanation:
Explanation:
Single-row functions in SQL operate on each row independently and can modify the returned value:
Option A: Incorrect. Single row functions can be used in multiple parts of a SELECT statement, including SELECT, WHERE, and ORDER BY clauses.
Option B: Incorrect. Single row functions can accept more than one argument, such as the CONCAT function, which can accept multiple string arguments.
Option C: Incorrect. They return one result for each row processed, not per table.
Option D: Correct. Single row functions can take various types of arguments including column names, literals, variables, and other expressions.
Option E: Correct. Functions can be nested within other functions, allowing complex expressions and calculations.
Option F: Correct. The data type of the result can differ from the arguments’ data types, such as the SUBSTR function returning a VARCHAR2 even when used on a number after converting it to a string.
Question 29
Which three actions can you perform by using the ALTER TABLE command?
Options:
A.
Drop pseudo columns from a table.
B.
Restrict all DML statements on a table.
C.
Drop all columns simultaneously from a table.
D.
Lock a set of rows in a table CE Rename a table.
E.
Rename a table
F.
Enable or disable constraints on a table.
Answer:
E, F
Explanation:
Explanation:
The actions possible using the ALTER TABLE command:
E. Rename a table: The ALTER TABLE command can be used to rename a table, although the syntax typically involves RENAME TO as part of table management.
F. Enable or disable constraints on a table: This is a standard use of the ALTER TABLE command, allowing for constraints to be enabled or disabled, which is critical for managing table integrity during data loads or maintenance.
Incorrect options:
A: You cannot drop pseudo columns from a table as they are not explicitly defined or managed like regular columns.
B: The ALTER TABLE command does not directly restrict DML statements; this would typically be managed through security roles or other database mechanisms.
C: Dropping all columns from a table simultaneously is not possible; a table must retain at least one column.
D: Locking a set of rows is performed with SQL commands like SELECT FOR UPDATE, not with ALTER TABLE.
Question 30
Which two are SQL features?
Options:
A.
providing graphical capabilities
B.
providing variable definition capabilities.
C.
providing database transaction control
D.
processing sets of data
E.
providing update capabilities for data in external files
Answer:
C, D
Explanation:
Explanation:
SQL (Structured Query Language) is a domain-specific language used in programming and designed for managing data held in a relational database management system.
A. False. SQL does not have graphical capabilities; it is a textual language for database interaction.
B. False. SQL supports variable definition, but it is not a core feature of the language. Variables are more commonly defined in procedural extensions to SQL, such as PL/SQL in Oracle.
C. True. SQL provides database transaction control through statements like COMMIT, ROLLBACK, and SAVEPOINT.
D. True. SQL is designed for processing sets of data, allowing for operations such as selection, projection, and joins on sets of rows.
E. False. SQL does not provide capabilities to update data in external files. It operates on data within the database.
Reference: [Reference:, Oracle Documentation on SQL Language: https://docs.oracle.com/database/121/SQLRF/toc.htm, ]
Question 31
Which three are true aboutprivileges and roles?
Options:
A.
System prilgese always set prilge for an entire database.
B.
PUBLIC acts as a default role granted to every user in a database.
C.
A user has all object privileges for every object in their schema by default.
D.
A role can contain a combination of several privileges and roles.
E.
A role is owned by the user who created it.
F.
All roles are owned by the sYs schema.
G.
PUBIIC can be revoked from a user.
Answer:
B, C, D
Explanation:
Explanation:
In Oracle Database 12c, the following are true about privileges and roles:
Option B: PUBLIC acts as a default role granted to every user in a database.
Option C: A user has all object privileges for every object in their schema by default.
Option D: A role can contain a combination of several privileges and roles.
Options A, E, F, and G are incorrect because:
Option A: System privileges can be set for specific schemas or objects, not always for the entire database.
Option E: Roles are not "owned" by users in the traditional sense of ownership; they are managed by the database and can be granted to any user.
Option F: Not all roles are owned by the SYS schema; roles are a database security concept and do not have an "owner".
Option G: The PUBLIC role is not something that can be revoked from a user; it is a default role that exists for all users.