Computer Knowledge
Database and SQL
3,929 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
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.
B
Correct answer
Explanation
When comparing NULL values in PL/SQL, any comparison operation (=, <, >, etc.) returns NULL (unknown), not true or false. In an IF statement, NULL is treated as false, so the condition a < b evaluates to false and the ELSE branch executes, printing 'n'. This is a fundamental NULL handling behavior in PL/SQL.
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.
-
ix_spc_framework
-
ix_sys_ikb
-
ix_sys_framework
-
ix_sys_screen
C
Correct answer
Explanation
When a new screen is added to IKB, a corresponding row is created in ix_sys_framework table. This table tracks all framework components including screens, their properties, and relationships within the IKB system.
B
Correct answer
Explanation
In JDA systems, modifying existing table structures by adding new columns can break dependencies, cause data migration issues, or violate system constraints. These systems typically require strict schema management through approved change processes rather than ad-hoc column additions.
-
Call guide
-
Run Process
-
External
-
None of the above
C
Correct answer
Explanation
In AR System, dynamic qualifications can use 'External' qualification type to execute external logic. Call guides and Run Process are separate workflow mechanisms not used for dynamic qualification.
-
a structure
-
invalid
-
client-independent
-
not mandatory
C
Correct answer
Explanation
In SAP, MANDT is the client field (Mandant in German). When MANDT is part of the primary key, data is client-specific (different for each client). Without MANDT in the primary key, the table contains client-independent data shared across all clients. It's still a valid table, not a structure, and 'mandatory' refers to field properties, not the MANDT field itself.
-
When a table is read infrequently
-
When a table is read frequently and the data seldom changes
-
When a table is read frequently and the data is always changing
-
When a table is linked to check tables
B
Correct answer
Explanation
Table buffering improves performance by storing table data in the local application server memory. It is best used for tables that are read frequently but whose data seldom changes, as frequent changes require expensive buffer invalidation across application servers.
C
Correct answer
Explanation
The statement table2[] = table1[] performs a direct memory copy of the entire internal table in one operation. This is the fastest method because it uses optimized internal memory copying. APPEND LINES would work but is slower for full copies. LOOP variants are much slower as they process row-by-row. Move-corresponding requires matching field names and processes iteratively.