MCQs Test Online

Database basics MCQs with answers

21 MCQs with answers on this topic. 12 are on this page: tap an answer to check it.

12 questions with answers

Question 1 of 12

In a relational database, a row of a table is also called what?

Show answer

Answer: B. Record

A row, or tuple, holds all the values for one entity.

Question 2 of 12

Which key uniquely identifies each record in a table and cannot be null?

Show answer

Answer: C. Primary key

A primary key must be unique and present in every row.

Question 3 of 12

A minimal set of attributes that could uniquely identify rows, from which the primary key is chosen, is called what?

Show answer

Answer: B. Candidate key

Each candidate key is minimal and unique, and one of them becomes the primary key.

Question 4 of 12

In a database table, a single column such as "Date of Birth" is called what?

Show answer

Answer: A. Field

A field is an attribute that is stored for every record.

Question 5 of 12

A column in one table that refers to the primary key of another table is called what?

Show answer

Answer: B. Foreign key

Foreign keys link related tables and help enforce referential integrity.

Question 6 of 12

A primary key made of two or more columns taken together is called what?

Show answer

Answer: D. Composite key

In a composite key the combination of values must be unique even if individual values repeat.

Question 7 of 12

Which SQL statement adds a new row to a table?

Show answer

Answer: A. INSERT INTO

INSERT INTO adds records, whereas ALTER TABLE changes the table's structure.

Question 8 of 12

Which SQL statement changes the values in existing rows?

Show answer

Answer: C. UPDATE

UPDATE modifies data and is usually limited by a WHERE clause.

Question 9 of 12

Which SQL clause filters groups after aggregation?

Show answer

Answer: C. HAVING

WHERE filters individual rows before grouping, while HAVING filters the grouped results.

Question 10 of 12

What does the abbreviation DBMS stand for?

Show answer

Answer: C. Database Management System

A DBMS is software that creates, stores, secures and retrieves data in databases.

Question 11 of 12

Which SQL clause is used to filter rows according to a condition?

Show answer

Answer: B. WHERE

WHERE keeps only the rows that satisfy the condition.

Question 12 of 12

Which SQL command removes a whole table, including its structure, from the database?

Show answer

Answer: D. DROP TABLE

DELETE removes rows but keeps the table, whereas DROP TABLE removes the table itself.

These are practice questions, not official or past papers. They may contain mistakes.

More Computer topics

Tests that include Computer