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
-
The name of the table we are selecting from
-
list of columns to be selected
-
Definition of the condition to be met for the rows to be returned
-
None of above
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.
-
The primary key column is a column or combination of columns whose values can be non-unique
-
The primary key is a column or combination of columns whose values uniquely identify each row in the table
-
The primary key is a column that can have NULL values
-
all of above
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.
-
An index is the same as alias
-
An index is a database table attribute, which speeds-up data search within a table
-
An index is a special way to join 2 or more tables
-
None of above
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.
-
A view is a special stored procedure executed when certain event occurs
-
A view is a database diagram
-
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
-
All of above
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.
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.
-
XML data types
-
Table value parameters
-
Transactions
-
none of these
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.
-
Local List
-
Field Value
-
Remote List
-
Prompt List
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.
-
convert input data to a standard format
-
test prperty values
-
perform a database INSERT
-
define and enforce comparison relationships among property values
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.
-
Database Save
-
Database Update
-
Database Deletion
-
All of the above
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.
-
Local List
-
Field Value
-
Remote List
-
Prompt List
B
Correct answer
Explanation
For frequently changing short-to-medium lists, Field Value should be specified in the TableEdit tab. Field Values are designed for dynamic list management that changes often, unlike Local Lists or Prompt Lists which are more static.
-
convert input data to a standard format
-
test prperty values
-
perform a database INSERT
-
define and enforce comparison relationships among property values
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.
-
Database Save
-
Database Update
-
Database Deletion
-
All of the above
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.
-
convert input data to a standard format
-
test prperty values
-
perform a database INSERT
-
define and enforce comparison relationships among property values
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.
-
Local List
-
Field Value
-
Remote List
-
Prompt List
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.
-
Database Save
-
Database Update
-
Database Deletion
-
All of the above
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.