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

Multiple choice technology packaged enterprise solutions
  1. SwitchUser(Password, UserID, ExtAuthInfo,AuthToken)

  2. SwitchUser(UserID, Password, ExtAuthInfo,AuthToken)

  3. SwitchUser(UserID, Password, AuthToken , ExtAuthInfo)

  4. SwitchUser(Password, ExtAuthInfo,AuthToken,UserID)

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology packaged enterprise solutions
  1. For every row insert

  2. For every 3 minutes

  3. Inserted rows are not buffered

  4. only when the buffer is full or a commit occurs

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. Database

  2. Each File

  3. Both a & b

  4. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Resets the values

  2. Copies the values of mathcing column names

  3. Copies and rests the value specified

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. Implicit

  2. Explicit

  3. inner join

  4. Outer join

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. Writes the record to the reject port

  2. Writes a descriptive error message to the error port

  3. Discards the information if you do not connect flows to the reject or error ports

  4. Processes all records

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology platforms and products
  1. Formula

  2. Compound Attributes

  3. Table Editor

  4. SQL Client

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. subquery results

  2. results of a query having the SYSDATE function

  3. results of a query having the GROUP BY clause

  4. results of a query having the DATE data type in the WHERE clause

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. Use subprograms as pasrt of packages instead of stand-alone parameters

  2. Use dynamic SQL’s constructed using concatenation of input values.

  3. Use bind arguments

  4. Usage of the NOT NULL constraint in PL/SQL code can degrade performance

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. REF CURSOR types cannot be defined inside a package

  2. SYS_ REFCURSOR can be used to declare cursor variables in stored procedures and functions

  3. A REF CURSOR return type can be declared using %TYPE or %ROWTYPE or a user-defined record.

  4. Only a weak REF CURSOR type can be used as a formal parameter of a stored procedure or function.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. It must be part of a package.

  2. It must be a pipelined table function.

  3. It must not be defined in an anonymous block.

  4. It must have at least one OUT or IN OUT parameter.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology platforms and products
  1. a. FROM

  2. b. WHERE

  3. c. GET

  4. d. SELECT

  5. e. IMPORT

Reveal answer Fill a bubble to check yourself
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.