Databases & DBMS MCQs
20 practice MCQs on this page Page 7 of 16
Tap an option to check your answer — the correct answer and full explanation appear after you choose.
Computer ScienceDatabases & DBMS PPSCID: LTP-7655
What is a Database Management System (DBMS)?
- AA computer printer
- BA web browser
- CA type of keyboard
- DSoftware that manages databases ✓ Correct answer
✓ Correct answer: Software that manages databases
Full explanation
A DBMS is software that manages databases, letting users store, retrieve, update and protect data in an organised way.
Computer ScienceDatabases & DBMS PPSCID: LTP-7656
Which property must a primary key always have?
- AUnique and not null ✓ Correct answer
- BIt may repeat in every row
- CIt must contain text only
- DIt must be a foreign key
✓ Correct answer: Unique and not null
Full explanation
A primary key must be unique and not null, so every row in the table can be identified by its key value.
Computer ScienceDatabases & DBMS PPSCID: LTP-7657
A foreign key in a table is used to refer to which of the following?
- AThe password of the user
- BThe primary key of another table ✓ Correct answer
- CThe name of the database server
- DA deleted record
✓ Correct answer: The primary key of another table
Full explanation
A foreign key refers to the primary key of another table, creating a link between the two tables.
Computer ScienceDatabases & DBMS PPSCID: LTP-7658
The main purpose of normalisation in database design is to:
- AIncrease data duplication
- BSlow down queries
- CReduce data redundancy ✓ Correct answer
- DDelete all indexes
✓ Correct answer: Reduce data redundancy
Full explanation
The main purpose of normalisation is to reduce data redundancy by organising tables so the same fact is not stored again and again.
Computer ScienceDatabases & DBMS PPSCID: LTP-7659
A table is in First Normal Form (1NF) when all of its values are:
- ARepeated in every row
- BStored as images
- CEncrypted
- DAtomic ✓ Correct answer
✓ Correct answer: Atomic
Full explanation
A table is in First Normal Form when all its values are atomic, meaning each cell holds a single indivisible value.
Computer ScienceDatabases & DBMS PPSCID: LTP-7660
In SQL, which constraint is used to specify that a column cannot contain a NULL value?
- ANOT NULL ✓ Correct answer
- BUNIQUE
- CPRIMARY KEY
- DCHECK
✓ Correct answer: NOT NULL
Full explanation
The NOT NULL constraint specifies that a column cannot contain a NULL value, so every row must have a value in that column.
Computer ScienceDatabases & DBMS PPSCID: LTP-7662
In the ACID properties of a database transaction, the letter A stands for:
- AAccuracy
- BAvailability
- CAtomicity ✓ Correct answer
- DAuthority
✓ Correct answer: Atomicity
Full explanation
In ACID, A stands for Atomicity, which means a transaction is treated as one indivisible unit that either completes fully or not at all.
Computer ScienceDatabases & DBMS PPSCID: LTP-7663
Which of the following is an advantage of a DBMS over a simple file system?
- AData can only be stored once
- BOnly one user can access data
- CNo backup is possible
- DData independence and less redundancy ✓ Correct answer
✓ Correct answer: Data independence and less redundancy
Full explanation
A DBMS gives data independence and less redundancy, so programs do not depend on the physical storage and the same data is not duplicated.
Computer ScienceDatabases & DBMS PPSCID: LTP-7664
In an Entity-Relationship (ER) model, an entity represents:
- AA real-world object or thing ✓ Correct answer
- BA computer virus
- CA network cable
- DA user password
✓ Correct answer: A real-world object or thing
Full explanation
In an ER model an entity represents a real-world object or thing, such as a student, an employee or a book, that is stored in the database.
Computer ScienceDatabases & DBMS PPSCID: LTP-7665
A candidate key is best described as a key that is:
- AAlways a foreign key
- BA minimal superkey ✓ Correct answer
- CNever unique
- DOnly used for sorting
✓ Correct answer: A minimal superkey
Full explanation
A candidate key is a minimal superkey, a set of columns that uniquely identifies a row with no unnecessary column.
Computer ScienceDatabases & DBMS PPSCID: LTP-7666
In a database, a transaction is best defined as:
- AA printed report
- BA backup file
- CA single unit of work ✓ Correct answer
- DA user login
✓ Correct answer: A single unit of work
Full explanation
A transaction is a single unit of work in a database, a group of operations that must all succeed or all be undone together.
Computer ScienceDatabases & DBMS PPSCID: LTP-7740
In database design, Second Normal Form (2NF) requires that a table is in 1NF and that every non-key column depends on:
- AThe whole primary key ✓ Correct answer
- BOnly part of the key
- CNo key at all
- DThe foreign key only
✓ Correct answer: The whole primary key
Full explanation
Second Normal Form requires that every non-key column depends on the whole primary key, not just part of a composite key.
Computer ScienceDatabases & DBMS PPSCID: LTP-7741
Third Normal Form (3NF) removes which kind of dependency from a table?
- APrimary key
- BTransitive dependency ✓ Correct answer
- CForeign key
- DIndex
✓ Correct answer: Transitive dependency
Full explanation
Third Normal Form removes transitive dependency, where a non-key column depends on another non-key column instead of the key.
Computer ScienceDatabases & DBMS PPSCID: LTP-7742
Boyce-Codd Normal Form (BCNF) is a stronger version of which normal form?
- AFirst Normal Form
- BFourth Normal Form
- CThird Normal Form ✓ Correct answer
- DFifth Normal Form
✓ Correct answer: Third Normal Form
Full explanation
Boyce-Codd Normal Form is a stronger version of Third Normal Form, dealing with cases where a non-key column determines part of a key.
Computer ScienceDatabases & DBMS PPSCID: LTP-7743
In SQL, the Data Definition Language (DDL) includes which of the following commands?
- ASELECT
- BINSERT
- CUPDATE
- DCREATE ✓ Correct answer
✓ Correct answer: CREATE
Full explanation
CREATE belongs to the Data Definition Language, which defines the structure of database objects such as tables.
Computer ScienceDatabases & DBMS PPSCID: LTP-7744
In SQL, the Data Manipulation Language (DML) includes which of the following commands?
- AINSERT ✓ Correct answer
- BCREATE
- CDROP
- DGRANT
✓ Correct answer: INSERT
Full explanation
INSERT belongs to the Data Manipulation Language, which is used to add, change and delete the data inside tables.
Computer ScienceDatabases & DBMS PPSCID: LTP-7745
In SQL, the GRANT command belongs to which language category?
- AData Definition Language
- BData Control Language (DCL) ✓ Correct answer
- CData Manipulation Language
- DQuery Language
✓ Correct answer: Data Control Language (DCL)
Full explanation
GRANT belongs to the Data Control Language (DCL), which controls permissions on database objects.
Computer ScienceDatabases & DBMS PPSCID: LTP-7746
Which SQL command is used to save all changes made by a transaction permanently?
- AROLLBACK
- BSAVEPOINT
- CCOMMIT ✓ Correct answer
- DDELETE
✓ Correct answer: COMMIT
Full explanation
The COMMIT command saves all changes made by a transaction permanently, ending the transaction.
Computer ScienceDatabases & DBMS PPSCID: LTP-7747
Which SQL command undoes all changes made by the current transaction?
- ACOMMIT
- BGRANT
- CCREATE
- DROLLBACK ✓ Correct answer
✓ Correct answer: ROLLBACK
Full explanation
The ROLLBACK command undoes all changes made by the current transaction, restoring the database to its earlier state.
Computer ScienceDatabases & DBMS PPSCID: LTP-7748
An INNER JOIN between two tables returns:
- AOnly rows that match in both tables ✓ Correct answer
- BAll rows from the left table only
- CAll rows from both tables
- DNo rows at all
✓ Correct answer: Only rows that match in both tables
Full explanation
An INNER JOIN returns only rows that match in both tables, leaving out rows with no match.
Practice these MCQs interactively
← Computer Science MCQs