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 packaged enterprise solutions
  1. Call Section and SQL Statement

  2. Call Section and PeopleCode

  3. Do While and Do Until

  4. Do Select and Do When

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

In PeopleSoft Application Engine, a step cannot contain both a Call Section action and a PeopleCode action - they are mutually exclusive. SQL can coexist with Call Section. Do While/Do Until/Do Select are different actions that can be combined.

Multiple choice technology packaged enterprise solutions
  1. SQL statements

  2. PeopleCode actions

  3. Call Section actions

  4. all SQL action types (SQL, Do When, Do While, Do Until, Do Select)

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

The ReUse Statement property in PeopleSoft Application Engine is specifically designed for SQL action types. This property allows SQL statements to be reused across multiple executions, improving performance by avoiding re-parsing. It applies to all SQL actions including SQL, Do When, Do While, Do Until, and Do Select. It does not apply to PeopleCode actions or Call Section actions, which have different execution models.

Multiple choice technology mainframe
  1. We can override parameters on EXEC statements and add DD statements.

  2. We can override, nullify and add parameters on all statements and add DD and/or OUTPUT

  3. We can add and override parameters to all statements, but can only nullify parameters

  4. We can nullify, override and add parameters to all statements, but can only add DD statements.

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

When calling a procedure (catalogued or instream), you can: override existing parameter values, nullify parameters (set to null), add new parameters, and add DD statements and/or OUTPUT statements. Option B correctly states all these capabilities. Options A, C, and D are incomplete - they miss some modification capabilities.

Multiple choice technology web technology
  1. 1, 4, 2, 3, 5

  2. 4, 1, 2, 3, 5

  3. 1, 5, 4, 2, 1

  4. 4, 1, 3, 2, 5

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

The correct order is: 1) Connect to MySQL server, 2) Select the database, 3) Execute the SQL query, 4) Fetch the data, 5) Close connection. This sequence (1,4,2,3,5 in the question's numbering) matches option A. Option B tries to select database before connecting - impossible. Option C and D have incorrect sequences.

Multiple choice technology databases
  1. SET NOCOUNT ON

  2. SET ARITHABORT ON

  3. SET NOCOUNT OFF

  4. SET ARITHABORT OFF

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

SET NOCOUNT ON prevents SQL Server from sending the number of rows affected message to the client for each statement. This reduces network traffic and can improve performance for stored procedures with multiple statements. Options B and D relate to ARITHABORT which controls query behavior on arithmetic overflows, and Option C is the opposite of what's needed.

Multiple choice technology databases
  1. SET NOCOUNT OFF

  2. SET XACT_ABORT ON

  3. SET NOCOUNT ON

  4. SET XACT_ABORT OFF

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

SET NOCOUNT ON disables the message showing the number of rows affected by T-SQL statements. This is the same question as 154415, testing the same concept. Option A (OFF) would enable the messages, Option B/D relate to XACT_ABORT which controls transaction behavior on errors, not row count messages.

Multiple choice technology databases
  1. A SELECT statement that uses WHERE column_name = NULL returns no results

  2. A SELECT statement that uses WHERE column_name = NULL returns the rows that have null values in column_name.

  3. A SELECT statement that uses WHERE column_name = NULL will throw error.

  4. A SELECT statement that uses WHERE column_name = NULL returns all the rows.

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

When SET ANSI_NULLS is OFF, the SQL standard behavior is overridden, and comparison operators like = against NULL evaluate to true for rows containing nulls. Thus, column_name = NULL successfully retrieves rows with null values, instead of returning empty results or throwing errors.

Multiple choice technology packaged enterprise solutions
  1. only for the Search Record

  2. only for the State Record

  3. only for the Temporary Record

  4. all the above

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

In PeopleSoft PeopleCode, the SearchInit and SearchSave events are specifically designed to work with the Search Record during search processing. They are not available for State Record, Temporary Record, or all record types - they are tied exclusively to the search functionality.

Multiple choice technology packaged enterprise solutions
  1. database table

  2. sql view

  3. derived view

  4. derived/work records

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

Derived or work records are temporary, in-memory buffers in PeopleSoft used for display or processing purposes; they do not write to database tables. Consequently, database-level operations like RowDelete and RowInsert do not fire PeopleCode events for them, unlike physical tables or views.

Multiple choice technology packaged enterprise solutions
  1. on all the records of the currently active page

  2. on the records present in the component buffer

  3. on the record that is currently being processed

  4. on all the records of the component

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

The RowSelect PeopleCode event fires as each row is being processed during a row-by-row operation (like ScrollSelect). At this point, you can only refer to fields on the record currently being processed - you don't have access to all records in the buffer or component.