Databases & DBMS MCQs
20 practice MCQs on this page Page 12 of 16
Tap an option to check your answer — the correct answer and full explanation appear after you choose.
Computer ScienceDatabases & DBMS PPSCID: LTP-8498
Which SQL clause sorts the result of a query?
- AWHERE clause
- BGROUP BY clause
- CORDER BY clause ✓ Correct answer
- DJOIN clause
✓ Correct answer: ORDER BY clause
Full explanation
The ORDER BY clause sorts the result of a query in ascending or descending order.
Computer ScienceDatabases & DBMS PPSCID: LTP-8499
Which SQL operation combines rows from two tables using a related column?
- AUNION
- BGROUP BY
- CORDER BY
- DJOIN ✓ Correct answer
✓ Correct answer: JOIN
Full explanation
A JOIN combines rows from two tables using a related column.
Computer ScienceDatabases & DBMS PPSCID: LTP-8500
Which key is a minimal set of columns that can uniquely identify a row?
- ACandidate key ✓ Correct answer
- BForeign key
- CPrimary key
- DSuper key
✓ Correct answer: Candidate key
Full explanation
A Candidate key is a minimal set of columns that can uniquely identify a row; one of them becomes the primary key.
Computer ScienceDatabases & DBMS PPSCID: LTP-8501
Which term means the accuracy and consistency of stored data?
- AData redundancy
- BData integrity ✓ Correct answer
- CData independence
- DData mining
✓ Correct answer: Data integrity
Full explanation
Data integrity means the accuracy and consistency of stored data, protected by constraints and rules.
Computer ScienceDatabases & DBMS PPSCID: LTP-8502
Which database object is a saved set of SQL statements that can be run by name?
- AView
- BIndex
- CStored procedure ✓ Correct answer
- DTrigger
✓ Correct answer: Stored procedure
Full explanation
A Stored procedure is a saved set of SQL statements that can be run by name.
Computer ScienceDatabases & DBMS PPSCID: LTP-8504
Which database type stores data in documents or key-value pairs instead of tables?
- ANoSQL database ✓ Correct answer
- BRelational database
- CHierarchical database
- DNetwork database
✓ Correct answer: NoSQL database
Full explanation
A NoSQL database stores data in documents or key-value pairs instead of tables, suiting flexible data.
Computer ScienceDatabases & DBMS PPSCID: LTP-8612
Which software is used to create and manage a database?
- ADatabase Management System ✓ Correct answer
- BWord processor
- CWeb browser
- DSpreadsheet
✓ Correct answer: Database Management System
Full explanation
A Database Management System is the software used to create and manage a database.
Computer ScienceDatabases & DBMS PPSCID: LTP-8613
In SQL, which clause is used to filter groups after GROUP BY?
- AWHERE
- BHAVING ✓ Correct answer
- CORDER BY
- DLIMIT
✓ Correct answer: HAVING
Full explanation
HAVING filters groups after GROUP BY. WHERE filters individual rows before grouping, ORDER BY sorts results and LIMIT restricts the number of rows.
Computer ScienceDatabases & DBMS PPSCID: LTP-8614
What is a primary key?
- AA field that links two tables
- BA password for a database
- CA field that uniquely identifies each record in a table ✓ Correct answer
- DThe first column of a table
✓ Correct answer: A field that uniquely identifies each record in a table
Full explanation
A primary key is a field that uniquely identifies each record in a table.
Computer ScienceDatabases & DBMS PPSCID: LTP-8615
What is a foreign key?
- AA key that is no longer used
- BA password for a foreign user
- CThe last column of a table
- DA field that links a table to the primary key of another table ✓ Correct answer
✓ Correct answer: A field that links a table to the primary key of another table
Full explanation
A foreign key is a field that links a table to the primary key of another table.
Computer ScienceDatabases & DBMS PPSCID: LTP-8616
What is a candidate key?
- AA field or combination of fields that can uniquely identify a record ✓ Correct answer
- BA key used by candidates in exams
- CA temporary password
- DA duplicate of the primary key
✓ Correct answer: A field or combination of fields that can uniquely identify a record
Full explanation
A candidate key is a field or combination of fields that can uniquely identify a record.
Computer ScienceDatabases & DBMS PPSCID: LTP-8618
Which language do you use to ask a database for information?
- AHTML
- BCSS
- CSQL ✓ Correct answer
- DJavaScript
✓ Correct answer: SQL
Full explanation
SQL is the language you use to ask a database for information.
Computer ScienceDatabases & DBMS PPSCID: LTP-8619
Which SQL command retrieves data from a table?
- AINSERT
- BUPDATE
- CDELETE
- DSELECT ✓ Correct answer
✓ Correct answer: SELECT
Full explanation
The SELECT command retrieves data from a table.
Computer ScienceDatabases & DBMS PPSCID: LTP-8712
Which SQL command adds a new record to a table?
- AINSERT ✓ Correct answer
- BSELECT
- CUPDATE
- DDELETE
✓ Correct answer: INSERT
Full explanation
The INSERT command adds a new record to a table.
Computer ScienceDatabases & DBMS PPSCID: LTP-8714
Which SQL command removes a record from a table?
- ASELECT
- BINSERT
- CDELETE ✓ Correct answer
- DUPDATE
✓ Correct answer: DELETE
Full explanation
The DELETE command removes a record from a table.
Computer ScienceDatabases & DBMS PPSCID: LTP-8715
Which SQL command creates a new table?
- ASELECT TABLE
- BINSERT TABLE
- CMAKE TABLE
- DCREATE TABLE ✓ Correct answer
✓ Correct answer: CREATE TABLE
Full explanation
The CREATE TABLE command creates a new table.
Computer ScienceDatabases & DBMS PPSCID: LTP-8716
Which SQL command removes a table completely?
- ADROP TABLE ✓ Correct answer
- BDELETE TABLE
- CREMOVE TABLE
- DCLEAR TABLE
✓ Correct answer: DROP TABLE
Full explanation
The DROP TABLE command removes a table completely.
Computer ScienceDatabases & DBMS PPSCID: LTP-8717
What is normalisation in a database?
- ACompressing a database file
- BOrganising data to reduce redundancy and improve integrity ✓ Correct answer
- CEncrypting database passwords
- DCopying a database to another server
✓ Correct answer: Organising data to reduce redundancy and improve integrity
Full explanation
Normalisation is organising data to reduce redundancy and improve integrity.
Computer ScienceDatabases & DBMS PPSCID: LTP-8718
Which normal form requires that every column holds only atomic values?
- ASecond Normal Form
- BThird Normal Form
- CFirst Normal Form ✓ Correct answer
- DBoyce-Codd Normal Form
✓ Correct answer: First Normal Form
Full explanation
First Normal Form requires that every column holds only atomic values.
Computer ScienceDatabases & DBMS PPSCID: LTP-8719
What is an ER diagram used for?
- AShowing the speed of a database
- BListing all users of a database
- CEncrypting database tables
- DShowing entities and their relationships in a database design ✓ Correct answer
✓ Correct answer: Showing entities and their relationships in a database design
Full explanation
An ER diagram is used for showing entities and their relationships in a database design.
Practice these MCQs interactively
← Computer Science MCQs