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
-
0001-01-01 and 0000-00-00-00.00.00.000000
-
0001-01-01 and 0001-01-01-01.01.01.000001
-
0000-00-00 and 0000-00-00-00.00.00.000000
-
0001-01-01 and 0001-01-01-00.00.00.000000
D
Correct answer
Explanation
For null date/timestamp values in certain legacy systems, low-date returns 0001-01-01 and low-timestamp returns 0001-01-01-00.00.00.000000 as minimum default values.
-
renaming the rule
-
changing the priority of rule
-
moving a rule to a target package
-
delete the rule
A
Correct answer
Explanation
In Rule Studio, queries can trigger actions like deploying rules, changing priorities, and moving rules between packages. However, renaming a rule typically requires direct editing through the rule editor interface rather than being triggered by a query operation. Query operations are designed for bulk management tasks, while renaming is an individual rule property change.
-
only for BAL rules
-
only for decision tales
-
For both BAL rules and decision tables
-
none
A
Correct answer
Explanation
BAL (Business Action Language) rules require a Definitions section to declare vocabulary, variables, and terms used in rule logic. Decision tables use a different structure - conditions and actions are defined directly in columns and rows, without a separate Definitions section. The question correctly identifies this distinction.
A
Correct answer
Explanation
In decision tables, empty cells in condition columns are not allowed as they create ambiguity. Each condition cell must have a defined value or expression to properly evaluate the rule logic. An empty condition would make it impossible to determine whether that condition is satisfied, leading to unpredictable behavior.
B
Correct answer
Explanation
The WHERE clause in SQL specifies conditions that rows must meet to be included in the result set. It filters data after the FROM clause retrieves it but before any grouping or aggregation happens. Without WHERE, all rows from the table are returned.
-
DELETE clause
-
INSERT clause
-
SELECT clause
-
JOIN clause
C
Correct answer
Explanation
The HAVING clause filters aggregated results and can only be used with SELECT statements that include GROUP BY. While WHERE filters individual rows before aggregation, HAVING filters groups after aggregation. HAVING cannot be used with DELETE, INSERT, or alone - it requires a SELECT query context.
-
Strong Query Language
-
Standard Query Language
-
Strict Query Language
-
Structured Query Language
D
Correct answer
Explanation
SQL stands for Structured Query Language, the standard language for managing and querying relational databases. The name reflects its structured approach to retrieving, manipulating, and defining data. It was developed at IBM in the 1970s and became an ANSI standard in 1986.
-
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.
-
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.