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. The name of the table we are selecting from

  2. list of columns to be selected

  3. Definition of the condition to be met for the rows to be returned

  4. None of above

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

The WHERE clause is followed by one or more conditions that define which rows should be returned. These conditions can include comparison operators (like =, >, <), logical operators (AND, OR, NOT), and pattern matching (LIKE). The database evaluates each row against these conditions.

Multiple choice technology databases
  1. The primary key column is a column or combination of columns whose values can be non-unique

  2. The primary key is a column or combination of columns whose values uniquely identify each row in the table

  3. The primary key is a column that can have NULL values

  4. all of above

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

A primary key is a column or set of columns in a relational database table that uniquely identifies each row. Its values must be unique and cannot be NULL, making alternative options incorrect.

Multiple choice technology databases
  1. An index is the same as alias

  2. An index is a database table attribute, which speeds-up data search within a table

  3. An index is a special way to join 2 or more tables

  4. None of above

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

An index is a database structure that creates a lookup table on one or more columns, dramatically speeding up data retrieval. Similar to a book index, it allows the database to find rows without scanning the entire table. Indexes trade off storage space and slower inserts/updates for faster query performance.

Multiple choice technology databases
  1. A view is a special stored procedure executed when certain event occurs

  2. A view is a database diagram

  3. A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are

  4. All of above

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

A view is a virtual table created by storing a SELECT query rather than data itself. When you query a view, the database executes the underlying query dynamically. Views simplify complex queries, provide security by hiding columns, and ensure consistent data access but don't physically store data like regular tables.

Multiple choice technology architecture
  1. True

  2. False

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

Entity bean primary keys must be serializable and comparable to support caching and database operations. The answer is False because Java primitive types (int, long, etc.) are not objects and cannot be used directly. Instead, you must use wrapper classes (Integer, Long, String) or custom primary key classes that implement Serializable. The container needs to handle primary keys as objects for operations like findByPrimaryKey.

Multiple choice technology databases
  1. XML data types

  2. Table value parameters

  3. Transactions

  4. none of these

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

Table-valued parameters (TVPs) were introduced in SQL Server 2008 as a new feature to pass multiple rows of data to stored procedures or functions. XML data types existed since SQL Server 2000, and transactions are a fundamental database concept present from early versions.

Multiple choice technology web technology
  1. Local List

  2. Field Value

  3. Remote List

  4. Prompt List

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

For short to medium-sized lists that change frequently, Field Value should be specified in the TableEdit tab. Field Values are optimized for dynamic lists. Local List and Remote List are for different scenarios, and Prompt List serves a different purpose in UI configuration.

Multiple choice technology web technology
  1. convert input data to a standard format

  2. test prperty values

  3. perform a database INSERT

  4. define and enforce comparison relationships among property values

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

Edit Input rules (Rule-Edit-Input) are used to format and convert user input (e.g., stripping dashes from a SSN) before it is saved to a property. Edit Validate rules are used to test property values, not Edit Input.

Multiple choice technology web technology
  1. Database Save

  2. Database Update

  3. Database Deletion

  4. All of the above

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

Trigger rules in Pega can execute on all database operations including save, update, and deletion. They are designed to respond to any database commit action, making 'All of the above' the correct answer as triggers fire regardless of the specific database operation type.

Multiple choice technology web technology
  1. convert input data to a standard format

  2. test prperty values

  3. perform a database INSERT

  4. define and enforce comparison relationships among property values

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

Edit Input rules (Rule-Edit-Input) are used to convert input data into a standard format. They normalize user input before processing. They are not used for testing property values, database operations, or enforcing comparison relationships.

Multiple choice technology web technology
  1. Database Save

  2. Database Update

  3. Database Deletion

  4. All of the above

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

Trigger rules in Pega are declarative rules that automatically execute processing when specific database operations occur. They can be configured to run on save (create), update, or delete operations, making 'All of the above' the correct answer.

Multiple choice technology web technology
  1. convert input data to a standard format

  2. test prperty values

  3. perform a database INSERT

  4. define and enforce comparison relationships among property values

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

Edit Input rules (Rule-Edit-Input) are used to format and convert user-entered input data into a standardized format (such as stripping dashes from a phone number) before it is saved or validated in the property.

Multiple choice technology web technology
  1. Local List

  2. Field Value

  3. Remote List

  4. Prompt List

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

For short to medium-sized lists that change frequently, the TableEdit tab should specify 'Field Value' as the source. Field Values allow easy addition, modification, and removal of list entries without code changes. Option A (Local List) is for hardcoded lists, option C (Remote List) is for external data sources, and option D (Prompt List) is for dynamic prompts. Field Value (B) is the best choice for frequently changing short/medium lists.

Multiple choice technology web technology
  1. Database Save

  2. Database Update

  3. Database Deletion

  4. All of the above

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

A Rule-Declare-Trigger is executed automatically by the Pega engine when an instance of a specified class is saved (inserted/updated) or deleted in the database, making all of the database events trigger sources.