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

  2. 4

  3. 5

  4. Program will terminate abnormally

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

The READ statement using the super descriptor SUPER-ID-NAME-AGE starting from '1234' will retrieve records in sequential order. With null-suppressed fields and 5 data rows, the READ operation processes all records and displays 4 of them based on the matching criteria defined by the super descriptor.

Multiple choice technology mainframe
  1. 0

  2. 1

  3. 2

  4. 3

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

The IDENTIFICATION-TABLE contains two records with IDENT-ID equal to '1234': (1234, AAAA, 23) and (1234, ABCD, 22). The FIND statement with IDENT-ID EQ '1234' will retrieve both matching records, so the LOOP displays 2 records.

Multiple choice technology mainframe
  1. 0

  2. 1

  3. 2

  4. 3

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

The SUPER-ID-NAME-AGE is a super descriptor that combines multiple fields (ID, NAME, AGE) into a single composite key. Searching for '1234' alone cannot match the full super descriptor value, which would be something like 'AAAA123423' for the first record. Since no super descriptor equals just '1234', zero records are returned.

Multiple choice technology databases
  1. LINESIZE

  2. FEEDBACK

  3. PAGESIZE

  4. PAUSE

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

In SQL*Plus, the FEEDBACK setting (configured via SET FEEDBACK n) determines the minimum number of rows a query must return to display the row count message (like '10 rows selected'). LINESIZE sets line width, PAGESIZE sets lines per page, and PAUSE halts output scrolling.

Multiple choice technology testing
  1. A. Call the ADO.Close function

  2. B. Use the close method for the RecordSet object

  3. C. Set the RecordSet and Connection objects equal to Nothing

  4. D. Use the close method for the RecordSet and Connection objects

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

After executing an SQL query and examining the results, you must close both the RecordSet object (which holds the query results) and the Connection object (which manages the database connection). Simply setting objects to Nothing does not properly close them and can lead to resource leaks. The close method should be called on both objects explicitly.

Multiple choice technology
  1. Add Search key in search record

  2. Ad PS_INSTALLATION record in component properties

  3. Add a view in Component properties with 1 key

  4. Add a record in Component properties with 1 key

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

Adding PS_INSTALLATION (with 'PS_' prefix, not 'Ad' as typoed) in component properties skips the search page by making the component directly accessible. Search keys and views with single keys don't bypass the search page - PS_INSTALLATION is the special flag that controls this behavior.

Multiple choice technology
  1. View

  2. Derived/Work Record

  3. SQL Table

  4. Sub record

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

Derived/Work records exist only in memory and are used for temporary storage or calculations. They have no underlying database table and don't need to be built. Views are built as SQL queries, SQL tables store actual data, and sub-records are reusable record definitions that inherit from built tables.

Multiple choice technology
  1. SQL Table & SQL View

  2. SQL Table & Derived/Work record

  3. SQL View & Temporary table

  4. Derived/Work record & Temporary table

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

State records in Application Engine programs must be either SQL Tables or Derived/Work records. SQL Views cannot be used because state records require read-write capability for storing process state, and views are typically read-only. Temporary tables are not appropriate for maintaining persistent state across executions.

Multiple choice technology
  1. EFFDT

  2. SYSDATE

  3. ROW_ADDED_DTTM

  4. ROW_EFFDT

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

EFFDT (Effective Date) is the standard PeopleSoft field for tracking temporal data. It enables effective dating by storing different versions of records with different effective dates, allowing systems to maintain historical, current, and future data simultaneously. SYSDATE and ROW_ADDED_DTTM are audit fields, while ROW_EFFDT is not a standard field.

Multiple choice technology
  1. SavePreChange

  2. SaveEdit

  3. RowDelete

  4. SavePostChange

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

PeopleCode event firing order matters: SaveEdit validates first, then SavePreChange before database update, SavePostChange AFTER successful database update. RowDelete fires during row deletion. The question specifically asks for the event that fires AFTER the database update completes, which is SavePostChange.

Multiple choice technology packaged enterprise solutions
  1. Rowinit event

  2. Prepopup event

  3. Searchsave event

  4. Workflow event

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

In PeopleSoft, the PrePopup event fires when a user is about to display a pop-up menu for a field, making it valid for component record field interactions. RowInit is for row initialization, SearchSave for search dialog save, and Workflow for workflow processing - none are popup-related.

Multiple choice technology packaged enterprise solutions
  1. Add the field SETID as a key field to each table you want to share and define a set control field

  2. Add the BUSINESS_UNIT and SETID fields as keys to the table you want to share

  3. Add the field BUSINESS_UNIT as a key field to each table you want to share and define a set control field

  4. Add the SETID field as a key to each table you wish to share

  5. Add the BUSINESS_UNIT field as a key to each table you wish to share

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

Table sharing in PeopleSoft requires adding the SETID field as a key to each shared table and defining a set control field to manage data segmentation across different sets. While BUSINESS_UNIT can be used, SETID with set control field is the primary mechanism for table sharing.

Multiple choice technology packaged enterprise solutions
  1. Run as a user with SELECT only permissions to the underlying database

  2. Run the SQL Alter in Audit only mode

  3. Run the SQL Alter in Report mode by selecting Build Script file Radio button

  4. Run as a user that has no permission to modify the underlying database

  5. Run as a user with AUDIT permissions to the underlying database

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

Running SQL Alter in Report mode with 'Build Script file' option generates a script showing the discrepancies without executing changes. This lets you review differences between record definitions and SQL tables safely. The other options involve permissions or audit modes that don't generate comparison scripts.