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

Multiple choice technology performance
  1. Optimizer Index Caching

  2. Optimizer Index Cost Adjustments

  3. Optimizer Mode

  4. Parallel Automatic Tuning

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Optimizer Index Cost Adjustments (OPTIMIZER_INDEX_COST_ADJ) parameter adjusts the cost of index access paths relative to full table scans. A value less than 100 makes indexes cheaper, encouraging index use; greater than 100 makes full table scans more attractive. The default of 100 treats them equally.

Multiple choice technology performance
  1. Automatic Maintenance Tasks(AMT)

  2. Automatic Workload Repository(AWR)

  3. Automatic Database Diagnostic Monitor(ADDM)

  4. Automatic Storage Management(ASM)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Automatic Workload Repository (AWR) is the built-in repository in Oracle 10g and later that collects performance statistics at regular intervals (default 30 or 60 mins), replacing and expanding upon the functionality of STATSPACK.

Multiple choice technology web technology
  1. Use of dynamic Query with System Privilege Account

  2. Use of Prepared Statements

  3. Use Least Privilege Account

  4. Both 1 and 3

  5. Both 2 and 3

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

To prevent SQL injection and unauthorized access, best practices dictate using Prepared Statements (to parameterize queries) and using a Least Privilege Account (to limit potential damage).

Multiple choice technology architecture
  1. View Helper

  2. DAO

  3. Service to Worker

  4. Composite Entity

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Data Access Object (DAO) pattern abstracts and encapsulates access to a data source. It manages connections and provides CRUD operations while hiding the details of data persistence from the rest of the application. This separates business logic from data access logic.

Multiple choice technology architecture
  1. Composite Entity

  2. Service to Worker

  3. Domain store

  4. Value list handler

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Composite Entity is a J2EE pattern used to model, represent, and manage interrelated persistent objects as a coarse-grained entity rather than fine-grained beans. This reduces the number of actual calls and improves performance.

Multiple choice technology security
  1. Use of dynamic Query with System Privilege Account

  2. Use of Prepared Statements

  3. Use Least Privilege Account

  4. Both 1 and 3

  5. Both 2 and 3

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Using prepared statements prevents SQL injection attacks by parameterizing queries. Using least privilege accounts limits potential damage from attacks by minimizing database permissions. Both are essential security practices.

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) lazy="true"

  2. b) lazy="false"

  3. c) lazy="on"

  4. d) lazy="off"

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Batch fetching in Hibernate is specifically useful when lazy loading is enabled (lazy="true"). It allows Hibernate to load multiple lazy associations in batches rather than one at a time, reducing the number of database queries and improving performance.

Multiple choice technology programming languages
  1. a) lazy="true"

  2. b) lazy="false"

  3. c) lazy="on"

  4. d) lazy="off"

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Batch fetching in Hibernate is specifically useful when lazy loading is enabled (lazy="true"). It allows Hibernate to load multiple lazy associations in batches rather than one at a time, reducing the number of database queries and improving performance.

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.