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

  2. 2

  3. 1

  4. 0

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

SQL BETWEEN is inclusive, so BETWEEN 'A' AND 'J' includes strings starting with both 'A' and 'J'. However, lexicographic ordering means 'JAMES' > 'J' (since 'JAMES' has more characters). Only 'JOHN' falls between 'A' and 'J' because 'J' alone matches the upper bound. The result is 1 row.

Multiple choice technology databases
  1. True

  2. False

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

Under the SQL standard, aggregate functions (like SUM, AVG, MIN, MAX, and COUNT) ignore NULL values in their evaluation, except for COUNT(). However, the prompt contains a typographical error ('ingnored', 'SQ: 2008'), and if COUNT is counted as an aggregate function, not *all ignore NULLs. Given standard exam content, the intended answer is True, but the statement has minor errors.

Multiple choice technology
  1. Changes to the order sets are always respected when changing a line in the set

  2. Defaulting rules can execute multiple lines

  3. All updates to a sales order must pass processing constraint rules except when canceling the order line

  4. Updating an order header after defaulting rules have been applied would have no effect on existing order lines.

Reveal answer Fill a bubble to check yourself
A,D Correct answer
Multiple choice technology databases
  1. True

  2. False

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

Using the NOT operator in SQL queries DECREASES performance. NOT prevents the database from using indexes efficiently and forces additional negation processing. Queries using NOT (or !=, NOT IN, NOT EXISTS) are slower than their positive equivalents because they require evaluating and rejecting rows rather than directly matching them.

Multiple choice technology platforms and products
  1. Rounding decimal values to Integers

  2. Removing special characters from a Text field

  3. Defining Primary Key constraint on a Table

  4. Assigning a default value to a field.

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

Defining a Primary Key constraint is a database schema operation, not a data transformation. The other options (rounding decimals, removing special characters, assigning default values) are all data transformations that modify the data itself during the ETL process. Constraints are structural, not transformational.

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.