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
A
Correct answer
Explanation
In PeopleSoft, the RowInsert event fires specifically for physical database records being added to the scroll area. It does not automatically trigger PeopleCode execution for Derived/Work fields, which must instead be initialized using events like RowInit or FieldDefault.
-
SwitchUser(Password, UserID, ExtAuthInfo,AuthToken)
-
SwitchUser(UserID, Password, ExtAuthInfo,AuthToken)
-
SwitchUser(UserID, Password, AuthToken , ExtAuthInfo)
-
SwitchUser(Password, ExtAuthInfo,AuthToken,UserID)
C
Correct answer
Explanation
In PeopleCode, the SwitchUser function changes the user ID context of the active session. Its correct syntax requires the parameters in the precise sequence of UserID, Password, AuthToken, and finally ExtAuthInfo. This sequence matches the third option.
-
For every row insert
-
For every 3 minutes
-
Inserted rows are not buffered
-
only when the buffer is full or a commit occurs
D
Correct answer
Explanation
Bulk insert optimization buffers rows in memory and flushes them to the database server only when the buffer is full or when an explicit commit occurs. This reduces network round-trips significantly compared to sending individual rows.
-
Database
-
Each File
-
Both a & b
-
None
B
Correct answer
Explanation
ISN (Internal Sequence Number) values are unique within each individual file but not across the entire database. Each file maintains its own ISN sequence independently.
-
Resets the values
-
Copies the values of mathcing column names
-
Copies and rests the value specified
-
None of the above
B
Correct answer
Explanation
Move by name copies the values from fields with matching column names in the source structure to the target structure. It does not reset values or perform copy-then-reset operations.
-
Implicit
-
Explicit
-
inner join
-
Outer join
B
Correct answer
Explanation
The record-required parameter is specific to Explicit join type in Ab Initio. It specifies how many input flows must contribute a record for output to be generated. This parameter doesn't apply to Implicit joins where the join conditions define the relationship.
-
Writes the record to the reject port
-
Writes a descriptive error message to the error port
-
Discards the information if you do not connect flows to the reject or error ports
-
Processes all records
A,B,C
Correct answer
Explanation
When input_select returns NULL in a Normalize component, three actions occur: the record goes to the reject port, an error message is written to the error port, and if these ports aren't connected, the record is silently discarded. This is the standard error handling behavior.
A
Correct answer
Explanation
True - query filters can be made optional in reporting tools. Optional filters allow reports to run even if the user doesn't provide a value for that filter, providing flexibility in report execution.
-
Formula
-
Compound Attributes
-
Table Editor
-
SQL Client
A
Correct answer
Explanation
In Asset Control, custom validation rules for incoming feed data are extended by creating and applying Formulas. While features like Compound Attributes define data relationships and the Table Editor allows manual data modifications, only Formulas are used to programmatically evaluate and enforce validation constraints.
-
subquery results
-
results of a query having the SYSDATE function
-
results of a query having the GROUP BY clause
-
results of a query having the DATE data type in the WHERE clause
A,B
Correct answer
Explanation
Subquery results cannot be stored in the query result cache because they represent intermediate results, making option A correct. Queries with SYSDATE function cannot be cached since SYSDATE returns different values on each execution, making option B correct. GROUP BY results and static DATE conditions in WHERE clauses can be cached, so options C and D are incorrect.
-
Use subprograms as pasrt of packages instead of stand-alone parameters
-
Use dynamic SQL’s constructed using concatenation of input values.
-
Use bind arguments
-
Usage of the NOT NULL constraint in PL/SQL code can degrade performance
C
Correct answer
Explanation
Using bind arguments is a primary defense against SQL injection because it separates SQL logic from data values, preventing malicious input from altering SQL structure. Option A is incorrect because package subprograms alone don't prevent injection. Option B is incorrect because concatenation actually increases vulnerability. Option D about NOT NULL constraint is irrelevant to SQL injection security.
-
REF CURSOR types cannot be defined inside a package
-
SYS_ REFCURSOR can be used to declare cursor variables in stored procedures and functions
-
A REF CURSOR return type can be declared using %TYPE or %ROWTYPE or a user-defined record.
-
Only a weak REF CURSOR type can be used as a formal parameter of a stored procedure or function.
B,C
Correct answer
Explanation
SYS_REFCURSOR is a pre-defined weak REF CURSOR type that can be used to declare cursor variables in stored procedures and functions, making option B correct. REF CURSOR return types can be declared using %TYPE, %ROWTYPE, or user-defined records, making option C correct. Option A is incorrect because REF CURSOR types can be defined inside packages. Option D is incorrect because both weak and strong REF CURSOR types can be used as formal parameters.
-
It must be part of a package.
-
It must be a pipelined table function.
-
It must not be defined in an anonymous block.
-
It must have at least one OUT or IN OUT parameter.
C,D
Correct answer
Explanation
For a PL/SQL function to be cached, it must not be defined in an anonymous block (which are transient), making option C correct. It must have at least one OUT or IN OUT parameter to support result caching, making option D correct. Option A is incorrect because standalone functions can also be cached. Option B is incorrect because pipelined table functions are not eligible for result caching.
-
a. FROM
-
b. WHERE
-
c. GET
-
d. SELECT
-
e. IMPORT
B
Correct answer
Explanation
In SQL, the WHERE clause specifies filtering criteria to restrict which rows are returned. In PeopleSoft Query, when you add criteria/conditions to filter data, these translate directly to WHERE clause conditions in the generated SQL. SELECT specifies columns, FROM specifies tables, GET and IMPORT are not SQL clauses.