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

  2. IMAGE

  3. FLOAT

  4. 1) and 2)

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

SQL_VARIANT can store most SQL Server data types except large object types like text, ntext, image, timestamp, and the MAX variants (varchar(max), nvarchar(max), varbinary(max), xml). TEXT and IMAGE are legacy large object types that SQL_VARIANT cannot handle. FLOAT is valid within SQL_VARIANT. The question has a typo (VARIEANT should be VARIANT).

Multiple choice technology platforms and products
  1. True

  2. False

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

Prompt Tables do not always validate against the underlying record. Prompt tables can be used for dropdown lists and selection purposes without performing validation against the actual record data. They serve primarily as a user interface aid to provide valid choices, but the validation logic is separate and configurable.

Multiple choice technology platforms and products
  1. Setting %Date as constant

  2. Required

  3. Specifying Default using Record and Field values

  4. Reasonable date

  5. Validate date

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

The 'Reasonable date' property is specifically designed to validate date fields against logical date ranges, including ensuring dates are not too far in the past or future. This property can be configured to validate that dates fall within a specific range like the last 30 days, preventing invalid or unreasonable date entries.

Multiple choice technology platforms and products
  1. SQL View

  2. Sub Record

  3. SQL Table

  4. Work Record

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

Work Records are in-memory structures used for temporary data storage and processing within PeopleSoft applications. Unlike SQL Tables, SQL Views, and Sub Records which must be built/created in the database, Work Records exist only at runtime and do not require any database build process or physical database objects.

Multiple choice technology databases
  1. True

  2. False

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

You can insert data into certain types of views called updatable views. Simple views (without DISTINCT, aggregations, GROUP BY, joins, or expressions) are inherently updatable. Complex views require INSTEAD OF triggers to allow inserts through the view.

Multiple choice technology databases
  1. PL/SQL program needs to be recompiled frequently.

  2. /SQL program that spends most of the time executing SQL

  3. PL/SQL program , which performs computation-intensive procedural operations and is recompiled rarely

  4. PL/SQL program , which is called frequently with the same parameter values by multiple sessions and is recompiled rarely.

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

Interpreted mode is useful when PL/SQL needs frequent recompilation (avoid native compilation overhead) or when the program spends most time executing SQL (interpretation overhead is negligible compared to SQL execution time). Native mode is better for computation-intensive procedural code that's compiled rarely.

Multiple choice technology databases
  1. A cursor variable points to the current roe in the result set of a multirow query stored in work area

  2. A cursor variable is an explicitly named work area in which the results of different multirow queries can be stored.

  3. A cursor variable can be used only if a query is performed and its results are processed in the same subprogram.

  4. A cursor variable can be used to perform a query in one subprogram , and process results in a different sub program

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Multiple choice technology platforms and products
  1. sql and call section

  2. sql and do while

  3. do while and do when

  4. do while and do until

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

In PeopleSoft Application Engine, SQL and Call Section actions are mutually exclusive and cannot be defined within the same step to prevent database lock contention and execution ambiguity. All other listed action combinations, such as conditional do loops (Do While, Do Until, Do When), can co-exist within steps.

Multiple choice technology platforms and products
  1. Select/Fetch

  2. Reselect

  3. Restart able

  4. All of the above

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

In PeopleSoft Application Engine, Do Select actions can be configured as Select/Fetch (to loop through a rowset), Reselect (to re-evaluate the query on each loop), or Restartable (to keep track of checkpoint state). Since all three are valid, 'All of the above' is the correct option.

Multiple choice technology mainframe
  1. True

  2. False

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

In Easytrieve, when accessing DB2 tables, a cursor is required even for a single fetch operation. This is because DB2 operations in Easytrieve are cursor-based by design - the cursor declaration and use are mandatory for SQL operations, regardless of the number of rows being fetched.

Multiple choice technology programming languages
  1. Give the MANDT field as a first field

  2. Select the primary key as defined in your db tables.

  3. Give initial values

  4. None of the above

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

When defining a structure in SE11 (SAP's data dictionary), you don't need to include MANDT (client field) as the first field (it's automatic in tables), you don't define primary keys in structures (that's for tables), and initial values aren't required. Therefore none of A, B, or C are mandatory rules.