Databases & DBMS MCQs

20 practice MCQs on this page Page 15 of 16

Tap an option to check your answer — the correct answer and full explanation appear after you choose.

Computer ScienceDatabases & DBMSID: DB-026

Which group of SQL commands manages transactions, including COMMIT and ROLLBACK?

  1. AData Definition Language (DDL)
  2. BData Manipulation Language (DML)
  3. CData Control Language (DCL)
  4. DTransaction Control Language (TCL) ✓ Correct answer
Computer ScienceDatabases & DBMSID: DB-027

Which SQL aggregate function returns the largest value in a column?

  1. ACOUNT
  2. BSUM
  3. CAVG
  4. DMAX ✓ Correct answer
Computer ScienceDatabases & DBMSID: DB-028

Which SQL aggregate function returns the total of all values in a numeric column?

  1. ACOUNT
  2. BSUM ✓ Correct answer
  3. CAVG
  4. DMIN
Computer ScienceDatabases & DBMSID: DB-029

Which SQL aggregate function returns the average value of a numeric column?

  1. ASUM
  2. BAVG ✓ Correct answer
  3. CCOUNT
  4. DMAX
Computer ScienceDatabases & DBMSID: DB-030

In SQL, the LIKE operator is used with which wildcard to match any number of characters?

  1. A?
  2. B% ✓ Correct answer
  3. C#
  4. D*
Computer ScienceDatabases & DBMSID: DB-031

Which statement about DELETE and TRUNCATE is correct?

  1. ATRUNCATE removes rows one by one and can be rolled back in all systems
  2. BDELETE removes selected rows, can use WHERE, and logs each deletion ✓ Correct answer
  3. CDELETE removes the table structure
  4. DTRUNCATE can use a WHERE clause
Computer ScienceDatabases & DBMSID: DB-032

A functional dependency X → Y means that:

  1. AKnowing X tells you Y ✓ Correct answer
  2. BX and Y are the same column
  3. CY determines X
  4. DX is the primary key
Computer ScienceDatabases & DBMSID: DB-033

An insertion anomaly is a problem in which:

  1. AA row cannot be added without adding unrelated facts ✓ Correct answer
  2. BA deleted row removes facts that should stay
  3. CChanging one value means changing it in many rows
  4. DA query runs too slowly
Computer ScienceDatabases & DBMSID: DB-034

A deletion anomaly is a problem in which:

  1. ADeleting a row loses facts that should have been kept ✓ Correct answer
  2. BA new row cannot be inserted
  3. CThe same value must be changed in many rows
  4. DAn index becomes too large
Computer ScienceDatabases & DBMSID: DB-035

An update anomaly is a problem in which:

  1. AA row cannot be deleted
  2. BChanging one fact means changing it in many places and some copies may be missed ✓ Correct answer
  3. CA table has no primary key
  4. DA foreign key has no match
Computer ScienceDatabases & DBMSID: DB-036

Fourth Normal Form (4NF) removes which kind of dependency?

  1. APartial dependency
  2. BTransitive dependency
  3. CMulti-valued dependency ✓ Correct answer
  4. DJoin dependency
Computer ScienceDatabases & DBMSID: DB-037

Fifth Normal Form (5NF) deals with:

  1. ATransitive dependencies
  2. BMulti-valued dependencies
  3. CJoin dependencies ✓ Correct answer
  4. DPartial dependencies
Computer ScienceDatabases & DBMSID: DB-038

Boyce-Codd Normal Form requires that every determinant (the left side of a functional dependency) must be:

  1. AA foreign key
  2. BA superkey ✓ Correct answer
  3. CA non-key attribute
  4. DAn index
Computer ScienceDatabases & DBMSID: DB-039

Denormalisation is the process of:

  1. ASplitting tables to remove redundancy
  2. BAdding controlled redundancy to tables to improve read performance ✓ Correct answer
  3. CRemoving all indexes
  4. DDeleting duplicate rows
Computer ScienceDatabases & DBMSID: DB-040

In the ACID properties, the letter C stands for:

  1. AControl
  2. BConsistency ✓ Correct answer
  3. CConcurrency
  4. DCommitment
Computer ScienceDatabases & DBMSID: DB-041

In the ACID properties, the letter I stands for:

  1. AIntegrity
  2. BIndexing
  3. CIsolation ✓ Correct answer
  4. DIndependence
Computer ScienceDatabases & DBMSID: DB-042

In the ACID properties, the letter D stands for:

  1. ADurability ✓ Correct answer
  2. BDependency
  3. CDistribution
  4. DDeadlock
Computer ScienceDatabases & DBMSID: DB-043

A deadlock in a database happens when:

  1. ATwo transactions wait forever for locks held by each other ✓ Correct answer
  2. BA transaction fails because of a wrong password
  3. CThe database runs out of disk space
  4. DA table has no primary key
Computer ScienceDatabases & DBMSID: DB-044

A shared lock on a row allows other transactions to:

  1. ARead the row but not change it ✓ Correct answer
  2. BChange the row freely
  3. CDelete the table
  4. DSee the password of the user
Computer ScienceDatabases & DBMSID: DB-045

An exclusive lock on a row means that:

  1. AOther transactions may read the row
  2. BNo other transaction may read or change the row until the lock is released ✓ Correct answer
  3. CThe row is deleted
  4. DThe lock is shared with all users

Practice these MCQs interactively