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 sort is in ascending by order by default
-
The sort is in descending order by default
-
The ORDER BY clause must precede the WHERE clause
-
The ORDER BY clause is executed on the client side
-
The ORDER BY clause comes last in the SELECT statement
-
The ORDER BY clause is executed first in the query execution
A,E
Correct answer
Explanation
ORDER BY sorts in ascending order by default (A is true). The ORDER BY clause must come last in a SELECT statement, after WHERE, GROUP BY, HAVING (E is true). It does not sort descending by default (B is false). It must come after WHERE, not before (C is false). It executes on the server, not client (D is false). It executes last in query processing, after the result set is formed (F is false).
-
update more than one row at a time.
-
delete more than one row at a time.
-
update only one row at a time.
-
delete only one row at a time.
A
Correct answer
Explanation
The UPDATE statement in SQL can modify multiple rows in a single execution. When the WHERE clause matches multiple rows, all those rows are updated simultaneously. UPDATE does not delete rows - that's what DELETE does. It can update one or many rows depending on the WHERE condition.
-
COMMIT
-
MERGE
-
UPDATE
-
DELETE
-
CREATE
-
DROP
B,C,D
Correct answer
Explanation
DML (Data Manipulation Language) statements manipulate data: MERGE combines insert/update/delete (B is true), UPDATE modifies existing data (C is true), DELETE removes rows (D is true). COMMIT is a transaction control statement (TCL), not DML (A is false). CREATE and DROP are DDL statements (Data Definition Language), not DML (E and F are false).
C
Correct answer
Explanation
The WHERE clause is used in SQL statements to filter records and specify search conditions. It allows you to extract only those records that fulfill a specified condition. FROM specifies the table source, while SEARCH and while are not valid SQL keywords.
A
Correct answer
Explanation
Properties can indeed trigger events beyond simple read/write operations. For instance, in C# implementing INotifyPropertyChanged, a property setter can raise the PropertyChanged event to notify UI elements or other components of data changes, enabling reactive programming patterns.
-
Define EFFDT
-
Define EFF_STATUS
-
Define EFFDT, EFF_STATUS
-
Define EFFDT as key, in descending order
D
Correct answer
Explanation
An effective dated table tracks data changes over time, requiring EFFDT (effective date) as the key field sorted in descending order. This ensures queries easily access the most current record first. Options A, B, and C are incomplete - defining EFF_STATUS or simply having the fields isn't sufficient. The key requirement is proper key definition and ordering.
-
CHAR
-
LONG CHAR
-
DATE
-
NUMBER
C
Correct answer
Explanation
Auto Update is a feature available on DATE type fields in PeopleSoft. It automatically updates the field to the current date when the row is modified. CHAR, LONG CHAR, and NUMBER field types do not support this auto-update functionality.
-
Prompt Table with Edit
-
Translate Table Edit
-
Yes/No Edit
-
Prompt Table with No Edit
D
Correct answer
Explanation
Prompt Table with No Edit allows users to add new values to the underlying prompt table directly. With Prompt Table with Edit enabled, users can only select from existing values and cannot add new ones. Translate Table Edit and Yes/No Edit have different purposes.
-
View
-
SQL Table
-
Derived/Work Record
-
Sub Record
-
PSFIELD
-
PSRECFIELD
-
PS_DBFIELD
-
PSDBFIELD
D
Correct answer
Explanation
In PeopleSoft, PSDBFIELD is the system catalog table that stores the definitions of all fields used to create page controls and database columns.
-
Setting %Date as constant
-
Required
-
Specifying Default using Record and Field values
-
Reasonable date
D
Correct answer
Explanation
The Reasonable Date property validates that dates are within an acceptable range (like not more than 30 days from current date). It prevents users from entering unrealistic dates. Required, Default, and Constant settings don't perform this date range validation.
-
Validates a field for Data to be entered on save of search dialog.
-
Allows to edit the search key.
-
Searches Edit fields for some values.
-
Option available only for Alternate Search Keys
A
Correct answer
Explanation
Selecting the 'Search Edit' property on a PeopleSoft record field forces the system to validate the data entered in that field when the search dialog is saved or executed.
-
Commit
-
Cursors
-
savepoint
-
truncate
B
Correct answer
Explanation
Cursors are not part of core SQL - they are part of procedural SQL extensions like PL/SQL (Oracle) or T-SQL (Microsoft). COMMIT, SAVEPOINT, and TRUNCATE are all standard SQL commands for transaction control and data definition respectively.
-
Union All
-
Distinct
-
Unique
-
Intersect
D
Correct answer
Explanation
The INTERSECT operator in SQL automatically sorts the final result set to eliminate duplicates and find common rows. UNION ALL, DISTINCT, and UNIQUE do not inherently guarantee sorted order.
-
Order by
-
Having
-
Group by
-
Where
A
Correct answer
Explanation
In standard SQL, a subquery cannot have an ORDER BY clause when used in contexts where a set operation is expected (like WHERE, HAVING, or as a derived table). The ORDER BY would only apply to the outer query. However, this is context-dependent - some modern SQL implementations allow ORDER BY in subqueries with LIMIT/OFFSET.