Databases & DBMS MCQs — Computer Science
4 practice MCQs
The correct answer is marked on every question, with its full explanation.
Computer ScienceDatabases & DBMS CSS PPSC FPSC NTSID: NWG-010
What is a database?
- AAn organised collection of data stored in a computer so it can be searched and used easily. ✓ Correct answer
- BA type of computer monitor.
- CA program that removes viruses from a computer.
- DA cable that joins two computers together.
✓ Correct answer: An organised collection of data stored in a computer so it can be searched and used easily.
Full explanation
A database is 'An organised collection of data stored in a computer so it can be searched and used easily.' A school database, for example, stores student records in tables. Why the others are wrong: 'A type of computer monitor.' — a monitor displays information. 'A program that removes viruses from a computer.' — that is antivirus software. 'A cable that joins two computers together.' — that is a network cable.
Computer ScienceDatabases & DBMS CSS PPSC FPSC NTSID: CMP-016
In a database, what is a table?
- AA set of rows and columns that stores related data ✓ Correct answer
- BA printed list of names
- CA type of computer virus
- DA cable that connects a printer
✓ Correct answer: A set of rows and columns that stores related data
Full explanation
A set of rows and columns that stores related data. That is what a table is in a database, for example a list of students with their names, ages and classes. Why the others are wrong: A printed list of names — that is a paper list, not a database table. A type of computer virus — a virus is harmful software, not part of a database. A cable that connects a printer — that is hardware, not a database structure.
Computer ScienceDatabases & DBMS CSS PPSC FPSC NTSID: CMP-037
In a database table, what is a record?
- AA single row in a table ✓ Correct answer
- BA single column in a table
- CThe name of the database
- DA type of database software
✓ Correct answer: A single row in a table
Full explanation
In a database table, a record is a single row that holds all the details of one item. A record is A single row in a table. Why the others are wrong: A single column in a table — a column holds one type of detail for all rows, not a whole record. The name of the database — the name of the database is just its title, not a record. A type of database software — database software is the program used to manage a database, not a record.
Computer ScienceDatabases & DBMS CSS PPSC FPSC NTSID: CMP-060
What is the primary key of a database table?
- AA password for the database
- BA column that stores pictures
- CThe first row of a table
- DA column that uniquely identifies each row ✓ Correct answer
✓ Correct answer: A column that uniquely identifies each row
Full explanation
The primary key is a column that uniquely identifies each row. No two rows can have the same value in the primary key column. Why the others are wrong: A column that stores pictures — any column can store pictures; that is not what a primary key is. The first row of a table — the first row is just a record, not the primary key. A password for the database — a password controls access; it does not identify rows.
Practise these MCQs interactively →
← Computer Science MCQs