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 mainframe
  1. True

  2. False

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

Multiple choice technology mainframe
  1. True

  2. False

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

Multiple choice technology mainframe
  1. True

  2. False

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

Multiple choice technology
  1. a. Local List

  2. b. Field Value

  3. c. Remote List

  4. d. Prompt List

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

Multiple choice technology databases
  1. ORDER BY

  2. FROM

  3. SELECT

  4. WHERE

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

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