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
-
Copy Rows between tables
-
Object List Processing
-
SQL Command Manager
-
Display, Grant or Revoke DB2 Privileges
A
Correct answer
Explanation
Option 3.3 from the File-Aid DB2 Main Menu is the 'Copy' function, which allows copying rows between tables. Option 3.4 is for Object List Processing, 3.2 for SQL Command Manager, and 3.6 for privilege management.
-
Persistent
-
Dynamic
-
Static
-
All of the above
D
Correct answer
Explanation
Lookup transformations support three cache types: Static (default, loads entire cache), Dynamic (updates cache during session), and Persistent (cache saved to disk for reuse). These optimize lookup performance for different use cases.
-
Every table must have a separate mapping file
-
Only parent table needs separate mapping fie
-
Only child table need separate mapping file
-
One mapping file can have mappings for one or more table.
D
Correct answer
Explanation
Hibernate mapping files can define mappings for multiple classes/tables in a single .hbm.xml file. The root element can contain multiple elements, each mapping a different database table. This provides flexibility in organizing mappings - you can have one file per table or group related tables.
-
One to one
-
One to many
-
Many to one
-
None of the above
B
Correct answer
Explanation
The element in Hibernate mapping is used for collections requiring key-value pair semantics, typically for one-to-many or many-to-many associations where the collection needs to be indexed. While , , and can also map one-to-many relationships, is specifically designed when you need to maintain index-based access to the collection elements.
-
connection.driver_class property should be changed
-
connection.url property should be changed
-
dialect property should be changed
-
All the above
D
Correct answer
Explanation
To switch the underlying database system, you must update the JDBC driver class, the connection URL, and the Hibernate SQL dialect to match the target database system. Therefore, all of these properties must be changed.
-
Using several dialect
-
Using several <session-factory>
-
Using several connection properties
-
Not possible to map more than one database
B
Correct answer
Explanation
To map and connect to multiple databases in a single Hibernate application, you must configure and instantiate a separate `` for each database, as a single session factory is tied to one database configuration.
-
Native SQL
-
HSQL
-
Both
-
None of the above
C
Correct answer
Explanation
Hibernate supports both Native SQL queries and Hibernate Query Language (HQL, often mistyped as HSQL) for querying database records, giving developers flexibility to write database-independent or database-specific queries.
-
session..commit()
-
session.getCommitTransaction()
-
session.getTransaction().commit()
-
session.getTransaction().save()
C
Correct answer
Explanation
To commit a transaction in Hibernate, you must first retrieve the active transaction from the session and then call its commit method using session.getTransaction().commit(). The other options are syntactically incorrect or do not exist.
-
Hibernate does not support lazy initialization for detached objects.
-
Access to a lazy association outside of the context of an open Hibernate session will result in an exception.
-
Lazy fetching is way to avoid unnecessary column reads.
-
All the above.
D
Correct answer
Explanation
All statements are true: Hibernate cannot lazily initialize associations for detached objects, accessing a lazy association outside an active session throws a LazyInitializationException, and lazy fetching avoids loading unnecessary columns or associations.
-
all
-
persist
-
delete
-
All the above
D
Correct answer
Explanation
The cascade attribute in Hibernate mapping accepts 'all', 'persist', 'delete', and other operations like 'merge', 'save-update', 'evict', 'replicate', 'refresh', and 'delete-orphan'. These determine which operations cascade from parent to child entities.
A
Correct answer
Explanation
Hibernate fully supports bi-directional associations (such as one-to-many and many-to-one) between data models, allowing navigation from either side of the relationship. This is typically configured using the mappedBy attribute.
B
Correct answer
Explanation
Oracle can use password files for authentication, but they are not mandatory disk components. Oracle can authenticate through operating system authentication, network authentication, or other methods without requiring password files.
B
Correct answer
Explanation
The DUMP function in Oracle returns a VARCHAR2 value containing the datatype code, length in bytes, and internal representation of an expression - it's for debugging, not backup. Oracle backup is done using Data Pump (EXPDP/IMPDP) or older export/import utilities.
-
File used for database connectivity
-
File used to define data format
-
File used to hold lookup data
-
File used to store Data Byte size
A
Correct answer
Explanation
A DB config file in Ab Initio stores connection parameters (like DSN, username, password, connection details) required to connect to databases for reading or writing data.
-
Using m_db unload command
-
Using m_db create dml command
-
Using m_db hosts command
-
Using m_db gendml command
D
Correct answer
Explanation
In Ab Initio, the m_db utility provides various subcommands for interacting with databases, and m_db gendml is specifically used to generate DML files from database tables.