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
-
TEXT
-
IMAGE
-
FLOAT
-
1) and 2)
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).
B
Correct answer
Explanation
SQL Server 2005 allows a maximum of 4096 columns in a SELECT statement. This is a hard limit in the query processor. Option C (512) was an older SQL Server 6.5 limit, while option A (1024) might be confused with earlier versions or other database constraints.
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.
-
Setting %Date as constant
-
Required
-
Specifying Default using Record and Field values
-
Reasonable date
-
Validate date
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.
-
SQL View
-
Sub Record
-
SQL Table
-
Work Record
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.
-
CHAR
-
LONG CHAR
-
DATE
-
NUMBER
C
Correct answer
Explanation
DATE fields support auto-update functionality (like automatically updating to the current timestamp when a record is modified). CHAR, LONG CHAR, and NUMBER fields do not have auto-update capabilities.
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.
-
PL/SQL program needs to be recompiled frequently.
-
/SQL program that spends most of the time executing SQL
-
PL/SQL program , which performs computation-intensive procedural operations and is recompiled rarely
-
PL/SQL program , which is called frequently with the same parameter values by multiple sessions and is recompiled rarely.
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.
-
Only local subroutins can be inlined
-
Inlining always reduces the execution time for the PL/SQL program unit
-
PLSQL_OPTIMIZE_LEVEL must be set to a value greater than or equal to 2
-
the PL/SQL programs that make use of relatively large helper subroutines are good candidates for inlining
-
A cursor variable points to the current roe in the result set of a multirow query stored in work area
-
A cursor variable is an explicitly named work area in which the results of different multirow queries can be stored.
-
A cursor variable can be used only if a query is performed and its results are processed in the same subprogram.
-
A cursor variable can be used to perform a query in one subprogram , and process results in a different sub program
-
sql and call section
-
sql and do while
-
do while and do when
-
do while and do until
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.
-
Select/Fetch
-
Reselect
-
Restart able
-
All of the above
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.
C
Correct answer
Explanation
PeopleSoft Application Engine has a limitation of 99 temporary table instances that can be defined and used within a single AE program. This is a hard limit in the system architecture. Temporary tables are crucial for parallel processing and managing multi-user execution scenarios.
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.
-
Give the MANDT field as a first field
-
Select the primary key as defined in your db tables.
-
Give initial values
-
None of the above
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.