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. FOR HOLD

  2. FOR UPDATE

  3. FOR FETCH

  4. WITH HOLD

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The WITH HOLD option in cursor declaration maintains the cursor position across transaction boundaries. When a transaction commits, a WITH HOLD cursor remains open and positioned, allowing continued fetching without repositioning. FOR FETCH is not a valid DB2 cursor option.

Multiple choice technology mainframe
  1. select, update, create, insert

  2. select, update, alter, modify

  3. alter, update, create, insert

  4. select, update, delete, insert

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The four DML (Data Manipulation Language) statements in DB2 are SELECT (retrieve), UPDATE (modify existing), DELETE (remove), and INSERT (add new). These are the core statements for modifying table data.

Multiple choice technology mainframe
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

SQL DATE, TIME, and TIMESTAMP data types are NOT accepted as character strings in COBOL programs. They must be declared using specialized SQL host variable declarations (like SQL DATE, SQL TIME, SQL TIMESTAMP) or converted using explicit date/time handling routines. Direct character string assignment would cause type mismatch errors.

Multiple choice technology mainframe
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Dynamic SQL, COMMIT or ROLLBACK does NOT destroy prepared statements. The prepared statement remains valid after transaction boundaries and can be reused without re-preparation. Only explicitly deallocation (via DEALLOCATE PREPARE) or session termination destroys the prepared statement.

Multiple choice technology platforms and products
  1. Create a task with single oracle enterprise stage that executes a custom SQL statement with FETCH ALL, that outputs to an Oracle enterprise stage.

  2. Create a job with three Oracle Enterprise stages to read from the tables and output to a collector stage which in turn outputs the data to an Oracle Enterprise stage.

  3. Create a job with a single Oracle Enterprise stage that executes a custom SQL statement with UNION ALL that outputs the data to an oracle enterprise stage.

  4. Create a job with three Oracle Enterprise stages to read from the tables and output to a Funnel stage which in turn outputs the data to an oracle enterprise stage.

Reveal answer Fill a bubble to check yourself
C,D Correct answer
Explanation

Both using a single Oracle Enterprise stage with a custom UNION ALL SQL statement and using three Oracle Enterprise stages combined via a Funnel stage are valid ways to consolidate and load the regional data.

Multiple choice technology databases
  1. INDICES

  2. COLUMNS

  3. ROWS

  4. NONE OF THE ABOVE

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A view is a virtual table that does not physically store data. While views contain columns and rows (from the underlying tables), they cannot contain indices directly - indices are created on base tables, not on views. Views inherit data access from their base tables' indices but cannot have their own indices.

Multiple choice technology programming languages
  1. Connection

  2. Command

  3. Parameter

  4. Error

  5. Field

  6. DSN

Reveal answer Fill a bubble to check yourself
A,B,C,D,E Correct answer
Explanation

ADO (ActiveX Data Objects) has seven main objects: Connection, Command, Parameter, Recordset, Error, Field, and Property. The question lists five of these (Connection, Command, Parameter, Error, Field). DSN is a configuration string, not an ADO object.