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
-
when two tables in a join query have only a single join condition
-
when two tables in a join query have too many join conditions
-
This is hard to determine.
-
when two tables in a join query have no join condition
D
Correct answer
Explanation
A Cartesian product (cross join) occurs when two tables are joined without any join condition or WHERE clause linking them. Every row from the first table is paired with every row from the second table.
A
Correct answer
Explanation
UNION ALL returns all rows from both queries including duplicates. UNION removes duplicates, while UNION ALL keeps them, making it faster when duplicates don't matter.
A
Correct answer
Explanation
ALTER SEQUENCE in Oracle changes sequence properties for future numbers only. Already generated numbers and cached values remain unaffected. This prevents breaking existing references.
-
Managers Field
-
Editors Field
-
Authors Field
-
Readers Field
-
Single value is selected
-
Value range is selected
-
Single value is excluded
-
None
C
Correct answer
Explanation
When a query excludes a single value (e.g., using NOT EQUAL or !=), database optimizers typically perform a full table scan rather than using an index, because almost all rows must be retrieved.
B
Correct answer
Explanation
In SAP BW, the Q table is the time-dependent master data attribute table, whereas the P table is used for time-independent master data attributes.
A
Correct answer
Explanation
Transaction code LBWG is used in SAP BW to delete setup tables for DataSource extract structures. RSA7 is for delta queue monitoring, LBWE for maintaining extract structures, and SE11 is the ABAP Dictionary transaction.
D
Correct answer
Explanation
SE49 is the transaction code in SAP used to manipulate tables behind other transaction codes. SE16 is for data browsing, SE26 is for ABAP dictionary, and SE51 is for screen painter - none of these directly manipulate table data like SE49 does.
-
It is NOT possible to switch unless no active transaction exists in UNDO1.
-
It is possible to switch to UNDO2, but current active transactions will abort.
-
It is possible to switch to UNDO2; current active transactions will be automatically migrated to UNDO2.
-
It is possible to switch to UNDO2; only current active transactions will continue to execute inside UNDO1.
D
Correct answer
Explanation
When switching undo tablespaces in Oracle, you can switch to a new undo tablespace while active transactions continue using the old one. Only new transactions will use the new undo tablespace. Active transactions will complete in UNDO1 until they finish or the undo tablespace is taken offline.
-
It is NOT possible to switch unless no active transaction exists in UNDO1.
-
It is possible to switch to UNDO2, but current active transactions will abort.
-
It is possible to switch to UNDO2; current active transactions will be automatically migrated to UNDO2.
-
It is possible to switch to UNDO2; only current active transactions will continue to execute inside UNDO1.
D
Correct answer
Explanation
When switching undo tablespaces, Oracle allows active transactions in the old undo tablespace (UNDO1) to complete normally. New transactions use UNDO2, but existing ones continue in UNDO1 until they commit or rollback. This is standard Oracle behavior - you don't need to wait for all transactions to complete before switching.
-
Char >> number
-
Char >> date
-
Number >> varchar2
-
Date >> varchar2
A,B,C,D
Correct answer
Explanation
All options are valid implicit data type conversions in many database systems: Char can implicitly convert to number (when numeric string), Char to date (when in date format), Number to varchar2, and Date to varchar2. These conversions happen automatically without explicit CAST or CONVERT functions.
-
CONCAT
-
MOD
-
ROUND
-
CONVERSION FUNCTION
A,B,C,D
Correct answer
Explanation
All listed options are single-row functions in SQL: CONCAT (string concatenation), MOD (modulo operation), ROUND (numeric rounding), and conversion functions (TO_CHAR, TO_DATE, etc.) all operate on individual row values rather than aggregating across multiple rows like aggregate functions.
A
Correct answer
Explanation
In Livelink WCM, CQL (Content Query Language) abstracts database access, allowing developers to query content objects without being directly dependent on the underlying physical database schema.
-
Continual Query Language
-
Counted Query Language
-
Continous Query Language
-
None of the Above
D
Correct answer
Explanation
CQL stands for Continuous Query Language, which is used for querying real-time data streams. Since "Continuous Query Language" is misspelled as "Continous" in option 525784, "None of the Above" is correct.
-
COMMIT
-
UPDATE
-
SAVEPOINT
-
SET TRANSACTIONS
A,C,D
Correct answer
Explanation
Transaction control language (TCL) commands manage changes made by DML statements. COMMIT, SAVEPOINT, and SET TRANSACTION are TCL commands, whereas UPDATE is a Data Manipulation Language (DML) command.