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
-
A unique index
-
.A composite index
-
A check constraint
-
.A generated column
A
Correct answer
Explanation
In SQL Server, XML data type columns can be indexed. While XML columns require special index types (PRIMARY XML index and secondary XML indexes), the question tests basic knowledge that XML data type supports indexing operations. A unique index is a valid operation on XML columns, though with specific syntax and constraints.
-
The statement will show the number of jobs in each department
-
The statement will show the number of employees in each department.
-
The statement will generate an error.
-
The statement will work if the GROUP BY clause is removed.
-
The INSERT statement is invalid; a valid table name is missing.
-
50 is not a valid DEPTNO value, since the subquery limits DEPTNO to 10.
-
The statement will work without error.
-
A subquery and a VALUES clause cannot appear together.
D
Correct answer
Explanation
Sequences in Oracle are outside transaction control. After creating a sequence, first nextval returns 1, second returns 2. ROLLBACK does not affect sequence values, so the third nextval call returns 3, not 1.
-
Lookup
-
Minus
-
Either a or b is sufficient
-
Both a and b are needed
C
Correct answer
Explanation
Both Lookup transformation and SQL MINUS operator can effectively compare data between two tables. Lookup joins sources for row-by-row comparison, while MINUS finds set differences. Either approach is sufficient for comparison tasks.
-
Normaliser
-
Joiner
-
Either a or b
-
None of the above
A
Correct answer
Explanation
The Normalizer transformation in Informatica is specifically designed to create multiple occurrences from a single input row. It denormalizes data by expanding columns into multiple rows, which is exactly what the question describes. Joiner transformations are for combining data from different sources, not for creating multiple occurrences.
-
Sorted input option
-
Using the table with more rows as master
-
Both a and b
-
Either a or b
A
Correct answer
Explanation
The 'Sorted input' option in a Joiner transformation significantly improves performance because it allows Informatica to use a more efficient merge join operation instead of a nested loop join. The smaller table should be used as master, so option B is incorrect.
-
a.where style='RANCH' or 'SPLIT' or 'TWOSTORY';
-
a.where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
-
a.where style in (RANCH, SPLIT, TWOSTORY);
-
a.where style in ('RANCH','SPLIT','TWOSTORY');
D
Correct answer
Explanation
In SAS, the IN operator compares a variable to a list of target values. The list of character values must be enclosed in parentheses, separated by commas or spaces, and each string must be quoted individually. Other options either use invalid syntax or omit necessary quotes.
-
IBS_ORDR_ST_DTL
-
LOB_ORDR_TYP_DMN
-
IBS_ORDR_ST_DTL_H
-
None
A
Correct answer
Explanation
IBS_ORDR_ST_DTL is the correct table to view IBS (Insurance Business System) ordering days. The other options represent different tables or may not be the primary table for this information.
-
Activeness
-
Atomicity
-
Consistency
-
Conessiveness
-
Isolation
-
Durability
B,C,E,F
Correct answer
Explanation
ACID properties ensure reliable database transactions: Atomicity (all-or-nothing execution), Consistency (database remains valid), Isolation (transactions don't interfere), and Durability (committed changes persist).
-
IBS_ORDR_ST_DTL
-
LOB_ORDR_TYP_DMN
-
IBS_ORDR_ST_DTL_H
-
None
A
Correct answer
Explanation
IBS_ORDR_ST_DTL is the table name used to see IBS ordering days. This table stores order state details including the days information for IBS (Insurance Business System) ordering processes.
-
Create
-
Delete
-
Append
-
Do Nothing
B
Correct answer
Explanation
A COMPLETE REFRESH of a materialized view deletes all existing rows before inserting the new data set. This differs from FAST REFRESH, which only applies incremental changes. The DELETE operation ensures no stale data remains.
-
Create
-
Delete
-
Append
-
None
B
Correct answer
Explanation
A complete refresh of a materialized view deletes all existing rows before inserting the new dataset. This differs from fast refresh (incremental) which only applies changes. The DELETE operation ensures the mview contains exactly the data from the refresh query, with no stale rows remaining.
A
Correct answer
Explanation
Local indexes are preferred on partitioned tables because they are automatically maintained with partition operations and provide better partition pruning. Global indexes span all partitions and require more maintenance during partition operations like DROP or TRUNCATE. Local indexes align with the table's partitioning strategy.
-
Procedure
-
Package
-
Functions
-
All
B
Correct answer
Explanation
Packages provide encapsulation by bundling related procedures, functions, variables, and cursors together, with public/private specifications controlling access. Procedures and functions are individual program units, but only packages offer true encapsulation through the package specification and body structure. Packages also support session-specific state persistence.