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

Multiple choice technology databases
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. y

  2. n

  3. error

  4. no output

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. exit

  2. break

  3. stop

  4. continue

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. %notfound

  2. %rowcount

  3. %isopen

  4. %isclose

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. ORA-01427

  2. ORA-01476

  3. ORA-00001

  4. ORA-01001

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. a) Property qualifier

  2. b) Property aliases

  3. c) Enumerated text values

  4. none of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology packaged enterprise solutions
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a structure

  2. invalid

  3. client-independent

  4. not mandatory

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. When a table is read infrequently

  2. When a table is read frequently and the data seldom changes

  3. When a table is read frequently and the data is always changing

  4. When a table is linked to check tables

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a

  2. b

  3. c

  4. d

Reveal answer Fill a bubble to check yourself
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.