1.
How many tables may be included with a join?
Correct Answer
D. All the above
Explanation
A join operation combines rows from two or more tables based on a related column between them. In this case, the question is asking how many tables can be included in a join. The correct answer is "all the above" because a join can involve one table, two tables, or even three tables depending on the specific query and the relationships between the tables. Therefore, the answer encompasses all the possible scenarios for joining tables.
2.
Which of the following SQL functions can operate on any data type?
Correct Answer
D. CEIL
Explanation
The CEIL function in SQL is used to round a number up to the nearest integer. It can operate on any data type, whether it is a numeric or non-numeric data type. This makes it a versatile function that can be used in various scenarios regardless of the data type being used.
3.
Assuming today is Monday, 21 NOV 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;
Correct Answer
C. 28-NOV-00
Explanation
The statement "SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;" is returning the date of the next Monday after the current date. Since today is Monday, 21 NOV 2000, the next Monday after this date would be 28 NOV 2000. Therefore, the correct answer is 28-NOV-00.
4.
In a PL/SQL block, a variable is declared as NUMBER without an initial value. What will its value be when it is first used in the executable section of the PL/SQL block?
Correct Answer
A. NULL
Explanation
When a variable is declared as NUMBER without an initial value in a PL/SQL block, its value will be NULL when it is first used in the executable section of the block.
5.
What is the result if two NULL values are compared to each other?
Correct Answer
D. Null
Explanation
When two NULL values are compared to each other, the result is NULL. This is because NULL represents an unknown or missing value, so the comparison cannot determine a definite result. Therefore, the answer is Null.
6.
PL/SQL raises an exception, in which TWO of the following cases:
Correct Answer(s)
A. When a SELECT statement returns no rows
B. When a SELECT statement returns more than one row
Explanation
PL/SQL raises an exception when a SELECT statement returns no rows because it is expecting at least one row to be returned. This can occur when the conditions in the WHERE clause are not met or when the table being queried is empty. PL/SQL also raises an exception when a SELECT statement returns more than one row because it is expecting only a single row to be returned. This can occur when the conditions in the WHERE clause are not specific enough or when there are duplicate records in the table.
7.
Functions for error trapping are contained in which section of a PL/SQL block?
Correct Answer
D. Exception
Explanation
The functions for error trapping are contained in the Exception section of a PL/SQL block. This section is used to handle any exceptions or errors that may occur during the execution of the block. It allows the programmer to specify what actions should be taken when a specific error occurs, such as logging the error, displaying a message, or rolling back a transaction. By including error trapping functions in the Exception section, the programmer can ensure that their code handles errors gracefully and continues to execute without crashing.
8.
The SQL WHERE clause
Correct Answer
B. Limits the row data are returned
Explanation
The correct answer is "limits the row data that are returned." The SQL WHERE clause is used to filter the rows in a table based on a specified condition. It allows you to specify a condition that must be met for a row to be included in the result set. By using the WHERE clause, you can limit the rows that are returned from a query based on specific criteria, such as filtering rows with a certain value in a particular column. Therefore, the WHERE clause limits the row data that are returned.
9.
Which of the following is true concerning triggers?
Correct Answer
C. They have an event, condition, and action
Explanation
Triggers are database objects that are created with SQL and are used to automatically execute a set of actions when a specific event occurs in a database. These events can include insertions, updates, or deletions of data. Triggers also have conditions, which determine when the trigger should be executed, and actions, which specify what actions should be performed when the trigger is fired. Therefore, the statement "They have an event, condition, and action" is true concerning triggers.
10.
In this PL/SQL statement, which of the following lines will produce an error?
Correct Answer
C. Into my_city, my_state
Explanation
The line "into my_city, my_state" will produce an error because the INTO clause is used to fetch data from the cursor into variables, but the variables my_city and my_state have not been declared or defined in this PL/SQL statement.