Computer Knowledge
Database Management Systems
5,344 Questions
Database Management Systems (DBMS) form the core framework for data storage, retrieval, and security in modern software applications. Concepts such as the E-R model, backup planning, SQL integration, and big data architecture are essential for computer knowledge sections. This hub offers a comprehensive set of practice questions to master DBMS fundamentals and advanced database operations.
E-R Model ConceptsBackup and RecoverySQL Server UpgradesJDBC and ODBCBig Data CharacteristicsData VirtualizationOracle Database
Database Management Systems Questions
-
Explain Plan
-
Trace
-
Parse
-
Bind
A,B
Correct answer
Explanation
Explain Plan and Trace are the correct first steps for SQL tuning. Explain Plan shows the execution plan and access paths. Trace provides detailed execution statistics. Parse and Bind are execution phases, not tuning tools - they describe how SQL is processed, not how to analyze or improve it.
A
Correct answer
Explanation
Bind variables (parameters) should always be used in SQL statements instead of concatenating values. This prevents SQL injection attacks, improves query performance through cursor sharing, and enhances security by separating code from data.
B
Correct answer
Explanation
To join N tables in SQL without causing a Cartesian product, you need a minimum of N-1 join conditions. For 3 tables, N-1 equals 2 join conditions. Fewer conditions result in an unwanted cross join, while more conditions are unnecessary for a basic join structure.
B
Correct answer
Explanation
Modern Oracle optimizers are cost-based and generally choose the most efficient join methods based on statistics. Explicitly controlling join types (using hints) is rarely necessary and can degrade performance if not done carefully. The optimizer should be trusted unless there's a proven performance issue.
B
Correct answer
Explanation
Updating only changed columns is better practice than updating all columns. It reduces undo/redo log generation, minimizes lock contention, improves performance, and makes auditing easier. Updating all columns unnecessarily consumes resources and can trigger cascading effects.
B
Correct answer
Explanation
Always fetching all columns is bad practice. It increases network traffic, memory usage, and I/O. Use SELECT with specific columns needed for the query. This is called 'projection' and is fundamental to SQL performance optimization.
-
TSO
-
IMS
-
BATCH
-
All the above can access
D
Correct answer
Explanation
DB2 can be accessed from all three environments listed: TSO (Time Sharing Option) provides interactive access, IMS (Information Management System) allows transaction processing with DB2, and BATCH jobs can submit SQL queries to DB2. DB2 was specifically designed to support multiple access interfaces in mainframe environments.
-
COMMIT
-
ROLLBACK
-
ALLOCATE
-
DEALLOCATE
B
Correct answer
Explanation
ROLLBACK establishes a syncpoint (rollback point) when a transaction ends unsuccessfully, undoing all changes since the last commit. COMMIT establishes a syncpoint for successful transactions. ALLOCATE and DEALLOCATE are resource management commands for memory or cursors, unrelated to transaction syncpoints.
A
Correct answer
Explanation
Stored procedures are precompiled collections of SQL statements and optional control-of-flow statements that are stored on the server. They provide a way to encapsulate business logic and database operations that execute server-side, reducing network traffic and improving security.
B
Correct answer
Explanation
The statement is false because stored procedures ARE stored in system tables of the current database after compilation. When first executed, a stored procedure is compiled and its execution plan is cached in system tables (like syscomments in some systems) for reuse. This caching improves performance on subsequent executions.
-
NORMAL
-
TEMPORARY
-
IMMEDIATE
-
FOR RECOVER
B
Correct answer
Explanation
When a tablespace has erroneous or corrupted datafiles, the TEMPORARY offline option is appropriate because it brings the tablespace offline without performing a checkpoint on the datafiles. NORMAL requires a checkpoint and clean datafiles, IMMEDIATE is used for emergency situations when NORMAL fails, and FOR RECOVER is used when the tablespace needs media recovery before being brought online.
-
DBA
-
RESOURCE
-
CONNECT
-
EXP_FULL_DATABASE
-
IMP_FULL_DATABASE
-
All the above
F
Correct answer
Explanation
Oracle provides several predefined roles to simplify privilege management. DBA grants all system privileges, RESOURCE allows users to create objects, CONNECT allows basic database connection, EXP_FULL_DATABASE grants full export privileges, and IMP_FULL_DATABASE grants full import privileges. All of these are valid predefined roles in Oracle.
-
By default, tables within the tablespace will not have all its changes written to redo.
-
It is a locally managed tablespace.
-
A temporary tablespace has been created.
-
An error will be produced; the AUTOALLOCATE parameter should be removed
D
Correct answer
Explanation
In Oracle, the AUTOALLOCATE clause is only valid with EXTENT MANAGEMENT LOCAL. Specifying EXTENT MANAGEMENT DICTIONARY along with AUTOALLOCATE will result in a syntax error, so the statement fails and produces an error.
A
Correct answer
Explanation
ADABAS allows multiple DDMs (Data Definition Modules) to be mapped to the same physical database, providing different logical views of the data. This is a standard feature for accessing the same database with different field selections and naming conventions. The statement is true.