Computer Knowledge
Database and SQL
4,213 Questions
Master structured query language commands, database joins, table constraints, and alias generation. This section covers relational database management concepts and query outputs essential for technical aptitude. These technical questions feature prominently in banking IT officer exams and computer knowledge sections.
SQL queries and aliasesDatabase table constraintsDatabase joins and transformationsStored procedures and functions
Database and SQL Questions
B
Correct answer
Explanation
Keyword parameters do not support retrieving future or past date values. The system likely only provides current date-related values through these keywords, not relative date calculations or offsets.
B
Correct answer
Explanation
Keyword Parameters in Business Objects do not support date arithmetic for advance or past dates. Keyword parameters are primarily for static or runtime value substitution, not date calculations. To get advance/past dates, you would need to use specific date functions like |EZCYMFP4| or other date manipulation keywords.
A
Correct answer
Explanation
DB2 SELECT queries return result sets that must be processed row by row. Using a cursor (DECLARE, OPEN, FETCH, CLOSE) is the standard method for handling query results. This is especially important for queries embedded in application programs where the result set needs to be processed sequentially.
A
Correct answer
Explanation
@DELETE,C is a valid delete statement syntax in this system. The '@' prefix indicates a command, DELETE specifies the operation, and 'C' appears to be a valid parameter or target identifier.
-
a. Local List
-
b. Field Value
-
c. Remote List
-
d. Prompt List
B
Correct answer
Explanation
In portal property configuration, the TableEdit tab is used for specifying how list-based properties are handled. For short to medium-sized lists that change frequently, 'Field Value' is the appropriate setting as it stores values directly in the property rather than maintaining a separate list reference. Local Lists are for static, predefined options, while Remote Lists and Prompt Lists serve different purposes.
-
ORDER BY
-
FROM
-
SELECT
-
WHERE
D
Correct answer
Explanation
The WHERE clause in SQL queries is specifically designed to filter rows based on conditions, limiting which rows are returned by the SELECT statement. FROM specifies the table source, SELECT chooses columns, and ORDER BY sorts the results. Only WHERE actually limits the rows selected based on criteria.
A
Correct answer
Explanation
PL/SQL blocks can indeed be nested within exception handlers. This allows you to handle specific exceptions with their own dedicated blocks, including additional declarations and nested exception handling. This is a common pattern for granular error management.
B
Correct answer
Explanation
In Oracle SQL/PL/SQL, adding NULL to a number yields NULL (5 + NULL is NULL, not 5), whereas concatenating NULL with a string ignores the NULL ('PL/' || NULL || 'SQL' evaluates to 'PL/SQL'). Since the first expression evaluates to NULL, the statement is false.
C
Correct answer
Explanation
The concatenation operator in Oracle PL/SQL is the double pipe symbol (||). This operator joins two strings together and is commonly used in dbms_output.put_line to display combined text. The plus sign (+) is used for arithmetic, not string concatenation in Oracle.
A
Correct answer
Explanation
In Oracle PL/SQL, the EXIT statement (or EXIT WHEN) is the standard syntax used to break out of a loop. The keyword break is used in languages like C/Java, stop is not a PL/SQL loop control statement, and continue skips the rest of the current iteration instead of breaking the loop.
-
%notfound
-
%rowcount
-
%isopen
-
%isclose
D
Correct answer
Explanation
The four explicit cursor attributes in PL/SQL are: %ISOPEN (checks if cursor is open), %FOUND (checks if last fetch returned a row), %NOTFOUND (opposite of %FOUND), and %ROWCOUNT (returns number of rows fetched). %ISCLOSE is not a valid cursor attribute - there is no such attribute in Oracle PL/SQL.
-
ORA-01427
-
ORA-01476
-
ORA-00001
-
ORA-01001
C
Correct answer
Explanation
DUP_VAL_ON_INDEX is a predefined PL/SQL exception that is raised when an INSERT or UPDATE statement attempts to duplicate values in a column with a unique constraint or unique index. This corresponds to Oracle error ORA-00001 (unique constraint violated). ORA-01427 is for single-row subquery returning multiple rows, ORA-01476 is division by zero, and ORA-01001 is for invalid cursor.
-
a) Property qualifier
-
b) Property aliases
-
c) Enumerated text values
-
none of the above
A
Correct answer
Explanation
A property qualifier is an optional feature that allows you to attach additional facts or metadata to a property's value. This enhances the property with contextual information beyond its primary value. Property aliases are alternative names for properties, and enumerated text values define a fixed set of allowed values, but only qualifiers add supplementary facts to the property value itself.
B
Correct answer
Explanation
Field display names are not configured in .pmd files - those files define metadata structure. Display names are typically set in the application configuration files, database tables like ix_sys_setting, or through the UI framework configuration.