Database Concepts Questions with Answers

18 practice questions on Database Concepts (DBMS) with answers and step-by-step solutions. Try 10 samples below, then practise all 18 free in the AptiNest app.

Sample questions

Question 1Easy

Which statement about a domain constraint is correct?

  1. It forbids NULL in primary keys
  2. It restricts the values an attribute may take
  3. It links two tables through keys
  4. It controls who may read a table

Answer: B. It restricts the values an attribute may take

Explanation

Domain constraints include data types, ranges and CHECK conditions on a column.

Step-by-step solution

  1. A domain is the set of allowed values for an attribute.
  2. Domain constraints enforce type, range or format, such as age between 0 and 150.
  3. So they restrict the values an attribute may take.

Why the other options are wrong

  • A. That is entity integrity.
  • C. That is referential integrity.
  • D. That is access control.

Tip: Domain = allowed values (type, range, CHECK).

Question 2Easy

A view in a relational database is best described as:

  1. A backup snapshot of the database
  2. A virtual table defined by a stored query
  3. A physical copy of a table
  4. An index on several columns

Answer: B. A virtual table defined by a stored query

Explanation

A view stores only its defining query; its rows are computed from the base tables when it is used (unless it is materialised).

Step-by-step solution

  1. A view is defined by a stored SELECT query.
  2. It stores no data of its own (unless materialised).
  3. Querying it runs the stored query on the base tables.

Why the other options are wrong

  • A. A backup is a stored copy, not a query.
  • C. A view is not a physical copy.
  • D. An index speeds lookups; it is not a table.

Tip: View = saved query, not saved data.

Question 3Easy

Which is a key advantage of a DBMS over storing data in separate application files?

  1. Reduced redundancy and controlled concurrent access
  2. Programs no longer need any queries
  3. Every file is automatically encrypted
  4. Data never needs to be backed up

Answer: A. Reduced redundancy and controlled concurrent access

Explanation

A DBMS centralises data, enforces integrity constraints, supports concurrent users and provides recovery, all of which ad hoc files lack.

Step-by-step solution

  1. Separate files duplicate data and become inconsistent.
  2. A DBMS centralises data and reduces redundancy.
  3. It also handles concurrent access, security and recovery.

Why the other options are wrong

  • B. Programs still query the DBMS.
  • C. Encryption is optional, not automatic.
  • D. Backups are still needed.

Tip: DBMS benefits: less redundancy, concurrency, integrity, security, recovery.

Question 4Easy

In a two-tier client-server database architecture, the application logic runs mainly on the:

  1. Database server
  2. Load balancer
  3. Web server
  4. Client

Answer: D. Client

Explanation

Two-tier clients talk directly to the database server; three-tier systems add an application server in the middle.

Step-by-step solution

  1. Two-tier: client application talks directly to the database server.
  2. Application and presentation logic run on the client.
  3. The server mainly runs the DBMS.

Why the other options are wrong

  • A. The server mainly handles data storage and queries.
  • B. Load balancers are not part of two-tier designs.
  • C. A separate web or application server is the extra tier in three-tier designs.

Tip: Two-tier: client + DB. Three-tier: client + app server + DB.

Question 5Medium

In a data warehouse star schema, the central table holding measures such as sales amount is the:

  1. Dimension table
  2. Lookup index
  3. Fact table
  4. Staging table

Answer: C. Fact table

Explanation

The fact table holds numeric measures with foreign keys to dimension tables such as Date, Product and Store.

Step-by-step solution

  1. A star schema has one central table with dimension tables around it.
  2. The central table stores measurable facts, such as sales amount.
  3. It is the fact table, with foreign keys to each dimension.

Why the other options are wrong

  • A. Dimension tables describe context, like date or product.
  • B. Not a star-schema term.
  • D. Staging tables hold raw data before loading.

Tip: Fact = numbers; dimensions = by what.

Question 6Medium

For a social network that frequently asks "friends of friends who like X", which kind of database fits best?

  1. Key-value store
  2. Column-family store
  3. Flat file
  4. Graph database

Answer: D. Graph database

Explanation

Graph databases store relationships directly as edges, so multi-hop traversals avoid repeated joins.

Step-by-step solution

  1. "Friends of friends" means following relationships several hops.
  2. Graph databases store relationships directly as edges.
  3. Multi-hop traversals are fast there, while relational databases need repeated joins.

Why the other options are wrong

  • A. Key-value stores cannot follow relationships.
  • B. Column-family stores suit wide, write-heavy data.
  • C. Flat files have no query support for relationships.

Tip: Relationships and multi-hop queries = graph database.

Question 7Medium

Which kind of view is generally NOT updatable through standard SQL?

  1. A view with a simple WHERE filter on one table
  2. A view that renames columns of one table
  3. A view selecting some columns of one table including its key
  4. A view that uses GROUP BY with aggregates

Answer: D. A view that uses GROUP BY with aggregates

Explanation

An aggregated row does not correspond to one base row, so the DBMS cannot map an update back to the table.

Step-by-step solution

  1. A GROUP BY row summarises many base rows.
  2. An update to a total cannot be traced back to specific rows.
  3. So such views are not updatable.

Why the other options are wrong

  • A. A simple filter on one table maps each view row to one base row.
  • B. Renaming columns keeps the one-to-one mapping.
  • C. Including the key makes each view row traceable.

Tip: Aggregates or DISTINCT in a view = not updatable.

Question 8Medium

A trigger in a DBMS is:

  1. Code that runs automatically when a specified event occurs on a table
  2. A type of index on a foreign key
  3. A lock held until commit
  4. A scheduled job that runs at fixed times of day, such as a nightly backup

Answer: A. Code that runs automatically when a specified event occurs on a table

Explanation

Triggers fire on INSERT, UPDATE or DELETE events, before or after the change, and can enforce complex rules or audit changes.

Step-by-step solution

  1. A trigger is attached to a table and an event (INSERT, UPDATE, DELETE).
  2. When the event happens, the trigger runs automatically.
  3. Example: write an audit row whenever a salary changes.

Why the other options are wrong

  • B. Triggers are code, not indexes.
  • C. Locks are concurrency tools.
  • D. Time-based jobs are scheduled jobs, not triggers.

Tip: Trigger = event-driven code on a table.

Question 9Medium

Horizontal partitioning (sharding) of a Customer table means:

  1. Different columns are stored on different servers
  2. Different rows are stored on different servers
  3. The table is split into a view and a base table
  4. Every server stores a full copy

Answer: B. Different rows are stored on different servers

Explanation

- Sharding splits rows by a shard key (e.g. region);
- vertical partitioning splits columns.

Step-by-step solution

  1. Horizontal partitioning splits by rows.
  2. For example, customers A to M on server 1 and N to Z on server 2.
  3. Each server holds the same columns for different rows.

Why the other options are wrong

  • A. Splitting columns is vertical partitioning.
  • C. Views are not partitions.
  • D. Full copies are replication.

Tip: Horizontal = rows; vertical = columns.

Question 10Medium

BASE, often used to describe many NoSQL systems, stands for:

  1. Basically Available, Soft state, Eventually consistent
  2. Batch, Atomic, Serial, Exclusive
  3. Balanced, Atomic, Stable, Expandable
  4. Basic Availability, Strong Encryption

Answer: A. Basically Available, Soft state, Eventually consistent

Explanation

BASE relaxes ACID's immediate consistency in favour of availability; replicas converge over time.

Step-by-step solution

  1. B = Basically Available.
  2. S = Soft state (state may change without input as replicas sync).
  3. E = Eventually consistent.

Why the other options are wrong

  • B. This is a made-up expansion.
  • C. This is a made-up expansion.
  • D. This is incomplete and incorrect.

Tip: BASE = Basically Available, Soft state, Eventually consistent.

Practise all 18 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all DBMS topics · All topics