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

Multiple choice technology databases
  1. C, D

  2. A, E

  3. A, B

  4. B, D

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

Views in SQL can be created with the CHECK OPTION to make them read-only, and can join multiple tables. Views can have ORDER BY in some databases (though with limitations), and GROUP BY is allowed. Column aliases are optional - the view can use original column names.

Multiple choice technology mainframe
  1. SQL CODE 100

  2. SQL CODE -911

  3. SCLCODE -811

  4. SQLCODE -305

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

SQLSTATE 20000-29999 range indicates execution warnings. SQLSTATE 02000 specifically means 'No data found' which corresponds to SQLCODE 100 in DB2 and other databases - this is returned when a SELECT retrieves no rows or cursor reaches end of data.

Multiple choice technology
  1. Header

  2. Static

  3. Dynamic

  4. All of the above

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

A table row can be declared as a header row (for titles/column headers), a static row (with fixed content), or a dynamic row (generated from data sources). All three declaration types are valid in table systems.

Multiple choice technology databases
  1. Use the specified table as the "Last" table in the join

  2. Use the specified table as the "Log" table in the join

  3. Use the specified table as the "Driving" table in the join

  4. Use the query as the "First" query in the set.

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

The LEADING hint explicitly tells the query optimizer to use the specified table as the driving table in the join order. The driving table is the first table accessed in the join execution plan, which can significantly impact performance.

Multiple choice technology databases
  1. select * from utlxplan;

  2. select * from plan_table;

  3. select plan from plan_table;

  4. select * from table(dbms_xplan.display);

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

Oracle provides two primary methods for retrieving execution plans: querying the PLAN_TABLE directly (which stores the plan) or using the DBMS_XPLAN.DISPLAY function for formatted output. The utlxplan view is outdated, and plan_table requires specific column selection.

Multiple choice technology databases
  1. allows Logical Rowid's to remain independent of physical rowid's

  2. allows rows to move across partitions

  3. allows rows to be physically located in a different tablespace, while remaining tagged to a partition

  4. allows rows to be copied to non-partitioned tables

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

ENABLE ROW MOVEMENT permits rows to move between partitions when their partition key values are updated. Without this clause, updating a partition key would fail because rows cannot naturally change partitions without explicit permission for row movement.

Multiple choice technology databases
  1. Online Redifinition method

  2. Hybrid Method

  3. Export/Import Method

  4. Insert with a Subquery method

  5. Dump Exchange Method

  6. Partition Exchange method

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

Oracle provides four primary methods for partitioning existing tables: Online Redefinition (using DBMS_REDEFINITION for minimal downtime), Export/Import (traditional data movement), Insert with Subquery (data transfer between tables), and Partition Exchange (metadata-only swap with pre-built partitions).

Multiple choice technology mainframe
  1. WITH UR

  2. WITH ROLLBACK

  3. WITH CONTINUE

  4. WITH HOLD

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

In DB2 and similar SQL databases, the WITH HOLD option on a cursor prevents the cursor from closing when a COMMIT operation is performed. Without this option, cursors close automatically at commit, requiring them to be reopened. WITH HOLD maintains cursor position across transaction boundaries.

Multiple choice technology
  1. Normalizer

  2. Custom

  3. Expression

  4. Router

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

While Update Strategy is the primary transformation for flagging rows, Custom (or Custom Transformation) can also be used to set row flags for insert, update, delete, and reject operations. Custom transformations allow you to write procedural code that can manipulate row flags based on complex business logic that might be difficult to express in Update Strategy expressions alone. This provides flexibility when complex conditional logic determines how rows should be treated.

Multiple choice technology
  1. 1

  2. 2

  3. 3

  4. 4

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

To join 4 tables using Joiner transformations in Informatica, you need 3 Joiner transformations. Joiner transformations only accept two input sources (master and detail). The process is hierarchical: join Tables A and B (Joiner 1), join that result with Table C (Joiner 2), then join that result with Table D (Joiner 3). Each joiner reduces the number of data streams by one, so for n tables, you need n-1 joiners.

Multiple choice technology programming languages
  1. RD entry

  2. INITIATE statement

  3. SELECT clause

  4. TERMINATE statement

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

In COBOL Report Writer functionality, the report name appears in the RD (Report Description) entry, INITIATE statement, and TERMINATE statement. The SELECT clause is part of the Environment Division's FILE-CONTROL paragraph and is used for file selection, not report selection - it does not contain report names.

Multiple choice technology
  1. T-Regualr Table, A-attachment

  2. T-Regular Table, B-attachment

  3. H-history, T- regualr, B-attachment

  4. T-Regualr, H-History, A-attachment

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

In Remedy ARS database schema, forms use specific table prefixes: 'T' for the main data table (regular/form table), 'B' for attachment blob data, and 'H' for history/audit trail. Therefore 'T-Regular Table, B-attachment' (Option B) is correct, and 'H-history, T- regualr, B-attachment' (Option C) is also correct as it includes all three table types.

Multiple choice technology
  1. True

  2. False

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

In ARS database, each attachment requires two tables: one for attachment metadata (fields, size, name, etc.) and one for the actual binary/blob data. This separation allows efficient storage and retrieval of attachment information without loading the entire binary content when only metadata is needed.