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 programming languages
  1. The step does not execute.

  2. The first numeric column is summed by default.

  3. The GROUP BY clause is changed to an ORDER BY clause.

  4. The step executes but does not group or sort data.

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

In PROC SQL, if you use GROUP BY without any summary (aggregate) functions like SUM, COUNT, AVG, etc., SAS automatically converts the GROUP BY clause to an ORDER BY clause. The step still executes but performs sorting instead of grouping. The other options are incorrect.

Multiple choice technology packaged enterprise solutions
  1. Model

  2. Formula

  3. Declarative constraint

  4. Declarative expression

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

A Declarative Expression automatically computes and updates a property's value dynamically whenever any of its input properties change. Models initialize values, Constraints validate conditions, and Formulas are components rather than rule types.

Multiple choice technology packaged enterprise solutions
  1. Class Key value

  2. Local List

  3. Remote List

  4. None of the above

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

Local List is the preferred choice when restricting properties to a set of legal values where the set size is small-to-medium and changes frequently. Local Lists are easier to maintain and modify compared to Class Key values (which are more static) or Remote Lists (which require external table management). They provide good performance for dynamic value sets.

Multiple choice technology packaged enterprise solutions
  1. Decision Shape in a Flow

  2. Activity

  3. Collection Rule

  4. Declare Expression

  5. None

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

Decision Tables are versatile evaluation rules that can be invoked across Pega. They are referenced in Flow Decision shapes, called in Activities, executed as collection steps, or used as calculations in Declare Expressions.

Multiple choice technology packaged enterprise solutions
  1. Declaring property as Exposed Property

  2. By changing at DB

  3. Property column visibility as Required

  4. Not possible

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

A property is made available for exposing by setting its column visibility to Required. This configuration makes the property visible and accessible for external systems or reporting. Declaring as an Exposed Property is not the correct mechanism, and direct database changes are not recommended. The column visibility setting is the proper way to control property exposure.

Multiple choice technology databases
  1. control structures such as if-then-else statements and loop.

  2. object types and methods.

  3. procedures and functions.

  4. none of these.

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

PL/SQL extends SQL with procedural programming features. It adds control structures (if-then-else, loops), modular programming with procedures and functions, and object-oriented features with object types and methods. Standard SQL is declarative and lacks these procedural capabilities.

Multiple choice technology databases
  1. consists of procedures and functions stored in database as standalone.

  2. block that is associated with an event that occurs in database

  3. constructed dynamically and executed once.

  4. none if these

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

An anonymous block in PL/SQL is a block of code that is not stored in the database with a name. It is constructed dynamically, compiled, and executed once during a session. Producures/functions are stored blocks, while triggers are associated with database events.

Multiple choice technology databases
  1. both are same

  2. both are different

  3. none of these

  4. the subtypes VARCHAR and STRING are equivalent to VARCHAR2

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

VARCHAR is the legacy SQL standard type, while VARCHAR2 is Oracle's proprietary variable-length string type. In Oracle, VARCHAR is deprecated and VARCHAR2 should be used. The subtypes VARCHAR and STRING are equivalent to VARCHAR2 for compatibility. VARCHAR has different NULL behavior than VARCHAR2.

Multiple choice technology security
  1. Data is injected from application into query

  2. The data is used to dynamically construct a SQL query

  3. when sql query is executed injected application code from the database.

  4. None of these

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

SQL injection occurs when user-supplied data is used to dynamically construct SQL queries without proper validation or parameterization, allowing attackers to manipulate query structure. Option A describes the flow but not the vulnerability mechanism. Option C describes a different scenario. SQL injection is specifically about the DYNAMIC construction of queries from untrusted input.

Multiple choice technology security
  1. Vulnerable to SQL Injection

  2. Vulnerable to DoS

  3. Both a & b

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice technology security
  1. SQL Injection is a type of security exploit in which the attacker is able to call built-in stored procedures

  2. SQL Injection attack technique forces a web site to echo client-supplied data, which executes in a user's web browser

  3. SQL Injection is a type of security exploit in which the attacker adds SQL statements in the user input

  4. SQL Injection attacks allow a malicious individual to execute undesired SQL statements

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

Forcing a website to echo client-supplied data that executes in a user's browser describes Cross-Site Scripting (XSS), not SQL Injection. The other options accurately describe characteristics and capabilities of SQL Injection, such as executing undesired statements or stored procedures.

Multiple choice technology security
  1. Client side only

  2. server side only

  3. Both client and server side

  4. In the SQL procedure

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

Password complexity validation must be implemented server-side because client-side checks can be easily bypassed by disabling JavaScript, modifying HTTP requests, or using API tools. Server-side validation ensures the security rule is enforced regardless of how the client submits data.