Computer Knowledge
Database Management Systems
5,543 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
-
a) StandardQueryCache and UpdateTimestampsCache
-
b) StandardQueryCache
-
c) QueryCache
-
d) QueryCache and TimestampsCache
A
Correct answer
Explanation
When hibernate.cache.use_query_cache is set to true, Hibernate enables two cache regions: StandardQueryCache (for caching query results) and UpdateTimestampsCache (for tracking when tables were last modified). This allows efficient query result caching while maintaining data consistency.
-
a) StandardQueryCache and UpdateTimestampsCache
-
b) StandardQueryCache
-
c) QueryCache
-
d) QueryCache and TimestampsCache
A
Correct answer
Explanation
When hibernate.cache.use_query_cache is set to true, Hibernate enables two cache regions: StandardQueryCache (for caching query results) and UpdateTimestampsCache (for tracking when tables were last modified). This allows efficient query result caching while maintaining data consistency.
-
a) NULL
-
b) Empty Object
-
c) unrecoverable exception
-
d) None of the above
C
Correct answer
Explanation
In Hibernate, session.load() returns a proxy object immediately without hitting the database. When you attempt to access a property on this proxy, if no matching row exists, it throws an unrecoverable ObjectNotFoundException.
-
a) a) controls how a particular SessionFactory interacts with the Data Base.
-
b) controls how a particular SessionFactory interacts with the second-level cache.
-
c) controls how a particular session interacts with the second-level cache.
-
d) None
C
Correct answer
Explanation
CacheMode controls how a particular Session interacts with the second-level cache. It determines whether the session should read from, write to, or interact with the second-level cache during operations like loading, saving, or updating entities.
-
a) Query.list()
-
b) Query.iterate()
-
c) Both are same
-
d) None of the above
A
Correct answer
Explanation
When instances are not in session or second-level cache, Query.list() performs better than Query.iterate(). Query.list() fetches all data in a single SQL query, while Query.iterate() first loads identifiers then loads each entity individually (N+1 queries problem), causing multiple database round-trips.
-
a) remove data from in memory
-
b) remove from database.
-
c) remove from sessionFactory
-
d) None of the above.
B
Correct answer
Explanation
The sess.delete() method in Hibernate removes the corresponding record from the database. It marks the entity for deletion and executes the DELETE SQL statement when the transaction is committed. It doesn't just remove from memory - it's a real database operation.
-
create tables automatically
-
b) create session object automatically
-
c) create Session Factory object automatically
-
d) None
A
Correct answer
Explanation
Setting hibernate.hbm2ddl.auto to create instructs Hibernate to automatically drop existing database tables and create new ones based on the entity mappings during application startup.
-
a) TRUE
-
b) FALSE
-
c) no matter
-
d) none of the above
B
Correct answer
Explanation
In Hibernate, the Session object is explicitly NOT thread-safe and is designed for use by a single thread at a time. Hibernate's documentation states that sharing a Session across threads without synchronization can cause unpredictable behavior. For concurrent access, you should use separate Session instances per thread or consider using Hibernate's SessionFactory with proper isolation. Each thread should obtain its own Session from the SessionFactory.
-
a) A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed
-
b) A Session will obtain a JDBC Connection (or a Datasource) on object create
-
c) A Session has no relation with JDBC Connection (or a Datasource)
-
d) none of the above
A
Correct answer
Explanation
In Hibernate, a Session is lightweight and does not immediately acquire a JDBC connection from the connection pool or datasource upon creation. It only obtains a connection when a database transaction or query requires it.
-
a) hibernate.cache.query_cache true
-
b) hibernate.cache.use_query_cache true
-
c) hibernate.cache.query_cache yes
-
d) none
B
Correct answer
Explanation
To enable query cache in Hibernate, you set the property hibernate.cache.use_query_cache to true (not 'yes' or without the 'use_' prefix). This property, along with configuring a second-level cache provider, enables caching of query result sets. Option B correctly states the property name and value. Options A and C are incorrect because they use 'query_cache' instead of 'use_query_cache'. Option D is wrong because query cache can be enabled with the correct property.
-
a) When the procedure contains no SQL statements.
-
b) When the procedure contains no PL/SQL commands.
-
c) When the procedure needs to be used by many client applications accessing several remote databases.
-
d) When the procedure needs to be used by many users accessing the same schema objects on a local database.
D
Correct answer
Explanation
Server-side procedures are created when they need to be used by many users accessing the same schema objects on a local database (D). This centralizes business logic on the database server. Options A and B are incorrect - procedures contain both SQL and PL/SQL. Option C describes distributed scenarios, not the primary use case for server-side procedures.
A
Correct answer
Explanation
SQL has two main execution environments: interactive (where users type SQL commands directly via tools like SQL*Plus, mysql, or psql) and embedded (where SQL statements are embedded within host programming languages like Java, C, or Python using APIs like JDBC or ODBC). This is a fundamental characteristic of SQL usage.
-
Stored Procedure
-
Business View
-
Universe
-
XML
C
Correct answer
Explanation
Web Intelligence reports are primarily created using Universes (option C), which act as semantic layers that map to database structures. While Stored Procedures (A) can be used as data sources, they are not the primary creation method. Business Views (B) and XML (D) are not standard methods for creating WEBI reports. The question is marked MC-2 but only has one correct answer.
-
Import Wizard
-
Report Conversion Tool
-
Publish Wizard
-
Designer
C
Correct answer
Explanation
The Publish Wizard (option C) is the Business Objects tool used to export/publish Crystal Reports to the BO server for centralized management and scheduling. Import Wizard (A) is for importing, not exporting. Report Conversion Tool (B) is for format conversion. Designer (D) is for creating Universes, not publishing reports.
-
binary data up to 4 gigabytes
-
character data up to 4 gigabytes
-
raw binary data of variable length up to 2 gigabytes
-
binary data stored in an external file, up to 4 gigabytes
-
a hexadecimal string representing the unique address of a row in its table
E
Correct answer
Explanation
ROWID is a pseudo-column that contains the hexadecimal string representing the unique physical address of a row in its table. It is not binary data, character data, or stored externally - it is an internal identifier used by Oracle to locate rows quickly.