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?
AData Definition Language (DDL)
BData Manipulation Language (DML)
CData Control Language (DCL)
DTransaction Control Language (TCL) ✓ Correct answer
✓ Correct answer: Transaction Control Language (TCL)
Full explanation
TCL — Transaction Control Language — manages transactions: COMMIT saves them, ROLLBACK undoes them, and SAVEPOINT marks a point to roll back to.
Computer ScienceDatabases & DBMSID: DB-027
Which SQL aggregate function returns the largest value in a column?
ACOUNT
BSUM
CAVG
DMAX ✓ Correct answer
✓ Correct answer: MAX
Full explanation
MAX returns the largest value in a column, MIN the smallest, SUM the total, AVG the average, and COUNT the number of rows.
Computer ScienceDatabases & DBMSID: DB-028
Which SQL aggregate function returns the total of all values in a numeric column?
ACOUNT
BSUM ✓ Correct answer
CAVG
DMIN
✓ Correct answer: SUM
Full explanation
SUM adds up all the values in a numeric column, for example SUM(marks) gives the total marks. COUNT counts rows, AVG averages, MIN finds the smallest.
Computer ScienceDatabases & DBMSID: DB-029
Which SQL aggregate function returns the average value of a numeric column?
ASUM
BAVG ✓ Correct answer
CCOUNT
DMAX
✓ Correct answer: AVG
Full explanation
AVG returns the average of the values in a numeric column, for example AVG(marks). SUM totals them, COUNT counts rows, and MAX finds the largest.
Computer ScienceDatabases & DBMSID: DB-030
In SQL, the LIKE operator is used with which wildcard to match any number of characters?
A?
B% ✓ Correct answer
C#
D*
✓ Correct answer: %
Full explanation
In standard SQL, % matches any number of characters (even none) and _ matches exactly one: WHERE name LIKE 'A%' finds every name starting with A.
Computer ScienceDatabases & DBMSID: DB-031
Which statement about DELETE and TRUNCATE is correct?
ATRUNCATE removes rows one by one and can be rolled back in all systems
BDELETE removes selected rows, can use WHERE, and logs each deletion ✓ Correct answer
CDELETE removes the table structure
DTRUNCATE can use a WHERE clause
✓ Correct answer: DELETE removes selected rows, can use WHERE, and logs each deletion
Full explanation
DELETE removes selected rows, accepts a WHERE clause, and logs each row so it can be rolled back. TRUNCATE removes all rows at once, keeps the table structure, takes no WHERE clause, and is faster.
Computer ScienceDatabases & DBMSID: DB-032
A functional dependency X → Y means that:
AKnowing X tells you Y ✓ Correct answer
BX and Y are the same column
CY determines X
DX is the primary key
✓ Correct answer: Knowing X tells you Y
Full explanation
X → Y means each value of X determines exactly one value of Y: if you know the student_id, you know the student's name. Normal forms are defined by which dependencies a table contains.
Computer ScienceDatabases & DBMSID: DB-033
An insertion anomaly is a problem in which:
AA row cannot be added without adding unrelated facts ✓ Correct answer
BA deleted row removes facts that should stay
CChanging one value means changing it in many rows
DA query runs too slowly
✓ Correct answer: A row cannot be added without adding unrelated facts
Full explanation
An insertion anomaly means you cannot store one fact without storing another: you cannot add a new department until it has at least one employee, because both facts live in the same row.
Computer ScienceDatabases & DBMSID: DB-034
A deletion anomaly is a problem in which:
ADeleting a row loses facts that should have been kept ✓ Correct answer
BA new row cannot be inserted
CThe same value must be changed in many rows
DAn index becomes too large
✓ Correct answer: Deleting a row loses facts that should have been kept
Full explanation
A deletion anomaly means deleting a row destroys facts that should survive: deleting the last employee of a department also deletes the department itself, because both facts live in one row.
Computer ScienceDatabases & DBMSID: DB-035
An update anomaly is a problem in which:
AA row cannot be deleted
BChanging one fact means changing it in many places and some copies may be missed ✓ Correct answer
CA table has no primary key
DA foreign key has no match
✓ Correct answer: Changing one fact means changing it in many places and some copies may be missed
Full explanation
An update anomaly means one fact is stored in many rows, so changing it means changing every copy: if a department name changes, every employee row carrying it must be updated, or the copies disagree.
Computer ScienceDatabases & DBMSID: DB-036
Fourth Normal Form (4NF) removes which kind of dependency?
APartial dependency
BTransitive dependency
CMulti-valued dependency ✓ Correct answer
DJoin dependency
✓ Correct answer: Multi-valued dependency
Full explanation
A table is in 4NF when it is in BCNF and has no non-trivial multi-valued dependency — two independent multi-valued facts, such as a person's languages and hobbies, stored in the same table.
Computer ScienceDatabases & DBMSID: DB-037
Fifth Normal Form (5NF) deals with:
ATransitive dependencies
BMulti-valued dependencies
CJoin dependencies ✓ Correct answer
DPartial dependencies
✓ Correct answer: Join dependencies
Full explanation
5NF (Project-Join Normal Form) removes join dependencies: a table must not be splittable into smaller tables that lose no information when joined back, except by its key.
Computer ScienceDatabases & DBMSID: DB-038
Boyce-Codd Normal Form requires that every determinant (the left side of a functional dependency) must be:
AA foreign key
BA superkey ✓ Correct answer
CA non-key attribute
DAn index
✓ Correct answer: A superkey
Full explanation
BCNF says that for every non-trivial functional dependency X → Y, X must be a superkey. It is stricter than 3NF, which also accepts the case where Y is part of a candidate key.
Computer ScienceDatabases & DBMSID: DB-039
Denormalisation is the process of:
ASplitting tables to remove redundancy
BAdding controlled redundancy to tables to improve read performance ✓ Correct answer
CRemoving all indexes
DDeleting duplicate rows
✓ Correct answer: Adding controlled redundancy to tables to improve read performance
Full explanation
Denormalisation deliberately adds back some redundancy — for example storing a department name with each employee — to avoid joins and speed up reads, accepting slower writes and some update risk.
Computer ScienceDatabases & DBMSID: DB-040
In the ACID properties, the letter C stands for:
AControl
BConsistency ✓ Correct answer
CConcurrency
DCommitment
✓ Correct answer: Consistency
Full explanation
Consistency means a transaction moves the database from one valid state to another: every rule the database declares — keys, foreign keys, NOT NULL, CHECK — still holds when the transaction ends.
Computer ScienceDatabases & DBMSID: DB-041
In the ACID properties, the letter I stands for:
AIntegrity
BIndexing
CIsolation ✓ Correct answer
DIndependence
✓ Correct answer: Isolation
Full explanation
Isolation means each transaction behaves as if it ran alone: concurrent transactions must not trip over each other, and the result must be the same as if they had run one after another.
Computer ScienceDatabases & DBMSID: DB-042
In the ACID properties, the letter D stands for:
ADurability ✓ Correct answer
BDependency
CDistribution
DDeadlock
✓ Correct answer: Durability
Full explanation
Durability means that once a transaction has committed, its effects survive a crash: the database must still hold them when it comes back up, which is achieved with logging.
Computer ScienceDatabases & DBMSID: DB-043
A deadlock in a database happens when:
ATwo transactions wait forever for locks held by each other ✓ Correct answer
BA transaction fails because of a wrong password
CThe database runs out of disk space
DA table has no primary key
✓ Correct answer: Two transactions wait forever for locks held by each other
Full explanation
A deadlock is a circle of waiting: transaction A holds a lock B needs, while B holds a lock A needs, so neither can move. The DBMS breaks it by aborting one of them.
Computer ScienceDatabases & DBMSID: DB-044
A shared lock on a row allows other transactions to:
ARead the row but not change it ✓ Correct answer
BChange the row freely
CDelete the table
DSee the password of the user
✓ Correct answer: Read the row but not change it
Full explanation
A shared lock lets many transactions read a row at the same time, but none of them may change it while the lock is held. A transaction that wants to change the row needs an exclusive lock.
Computer ScienceDatabases & DBMSID: DB-045
An exclusive lock on a row means that:
AOther transactions may read the row
BNo other transaction may read or change the row until the lock is released ✓ Correct answer
CThe row is deleted
DThe lock is shared with all users
✓ Correct answer: No other transaction may read or change the row until the lock is released
Full explanation
An exclusive lock gives one transaction sole access to a row: no other transaction may read or change it until the lock is released. That is how a write is protected.