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

Multiple choice technology programming languages
  1. a) StandardQueryCache and UpdateTimestampsCache

  2. b) StandardQueryCache

  3. c) QueryCache

  4. d) QueryCache and TimestampsCache

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) StandardQueryCache and UpdateTimestampsCache

  2. b) StandardQueryCache

  3. c) QueryCache

  4. d) QueryCache and TimestampsCache

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) a) controls how a particular SessionFactory interacts with the Data Base.

  2. b) controls how a particular SessionFactory interacts with the second-level cache.

  3. c) controls how a particular session interacts with the second-level cache.

  4. d) None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) Query.list()

  2. b) Query.iterate()

  3. c) Both are same

  4. d) None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) remove data from in memory

  2. b) remove from database.

  3. c) remove from sessionFactory

  4. d) None of the above.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. create tables automatically

  2. b) create session object automatically

  3. c) create Session Factory object automatically

  4. d) None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) TRUE

  2. b) FALSE

  3. c) no matter

  4. d) none of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed

  2. b) A Session will obtain a JDBC Connection (or a Datasource) on object create

  3. c) A Session has no relation with JDBC Connection (or a Datasource)

  4. d) none of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a) hibernate.cache.query_cache true

  2. b) hibernate.cache.use_query_cache true

  3. c) hibernate.cache.query_cache yes

  4. d) none

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. a) When the procedure contains no SQL statements.

  2. b) When the procedure contains no PL/SQL commands.

  3. c) When the procedure needs to be used by many client applications accessing several remote databases.

  4. d) When the procedure needs to be used by many users accessing the same schema objects on a local database.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Stored Procedure

  2. Business View

  3. Universe

  4. XML

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Import Wizard

  2. Report Conversion Tool

  3. Publish Wizard

  4. Designer

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. binary data up to 4 gigabytes

  2. character data up to 4 gigabytes

  3. raw binary data of variable length up to 2 gigabytes

  4. binary data stored in an external file, up to 4 gigabytes

  5. a hexadecimal string representing the unique address of a row in its table

Reveal answer Fill a bubble to check yourself
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.