Database Systems Quiz

Database systems store and manage data reliably. Questions cover the relational model, keys, normalisation, SQL, transactions and the role of a database management system.

What this quiz covers

Study tip: Draw a small entity-relationship diagram for a school or shop; it connects keys, tables and normalisation.

Questions, answers and explanations

1. What does DBMS stand for?

  1. Database Management System
  2. Data Backup Management System
  3. Database Memory System
  4. Data Management Service

Answer: Database Management System

A DBMS is software used to create, manage, and organize databases.

2. Which of the following is an example of a DBMS?

  1. MySQL
  2. Google Chrome
  3. Windows
  4. MS Word

Answer: MySQL

MySQL is a popular relational database management system.

3. What is a database?

  1. A programming language
  2. A collection of related data
  3. A compiler
  4. A web browser

Answer: A collection of related data

A database stores related information in an organized manner.

4. Which type of database stores data in tables consisting of rows and columns?

  1. Relational Database
  2. Hierarchical Database
  3. Network Database
  4. Object Database

Answer: Relational Database

A relational database stores data in tables with rows and columns.

5. Which language is primarily used to interact with relational databases?

  1. HTML
  2. Java
  3. SQL
  4. CSS

Answer: SQL

SQL (Structured Query Language) is used to create, retrieve, update, and delete data in relational databases.

6. What is the primary purpose of a Primary Key?

  1. To store duplicate values
  2. To uniquely identify each record in a table
  3. To connect two databases
  4. To sort records automatically

Answer: To uniquely identify each record in a table

A Primary Key uniquely identifies every record in a table and cannot contain NULL values.

7. A Foreign Key is used to:

  1. Delete records
  2. Create indexes
  3. Establish a relationship between two tables
  4. Store duplicate data

Answer: Establish a relationship between two tables

A Foreign Key links one table to another by referencing the Primary Key of another table.

8. Which key can uniquely identify a record and is selected as the Primary Key?

  1. Foreign Key
  2. Candidate Key
  3. Composite Key
  4. Alternate Key

Answer: Candidate Key

A Candidate Key is a column (or set of columns) that can uniquely identify each row in a table.

9. What is a Composite Key?

  1. A key made from multiple tables
  2. A key consisting of two or more columns
  3. A duplicate key
  4. A temporary key

Answer: A key consisting of two or more columns

A Composite Key combines two or more columns to uniquely identify a record.

10. Which key contains one or more Candidate Keys?

  1. Foreign Key
  2. Primary Key
  3. Super Key
  4. Composite Key

Answer: Super Key

A Super Key is a set of one or more attributes that can uniquely identify a record.

11. What is the main purpose of database normalization?

  1. To increase data redundancy
  2. To reduce data redundancy and improve data integrity
  3. To create more tables unnecessarily
  4. To speed up internet connections

Answer: To reduce data redundancy and improve data integrity

Normalization organizes data to minimize redundancy and maintain consistency.

12. In which Normal Form (NF) are all attributes atomic (indivisible)?

  1. First Normal Form (1NF)
  2. Second Normal Form (2NF)
  3. Third Normal Form (3NF)
  4. Boyce-Codd Normal Form (BCNF)

Answer: First Normal Form (1NF)

1NF requires that each column contains only atomic (single) values.

13. Which SQL command is used to create a new table?

  1. INSERT
  2. CREATE TABLE
  3. UPDATE
  4. ALTER

Answer: CREATE TABLE

The CREATE TABLE statement is used to create a new table in a database.

14. Which SQL command is used to insert new records into a table?

  1. SELECT
  2. UPDATE
  3. INSERT INTO
  4. DELETE

Answer: INSERT INTO

The INSERT INTO statement adds new rows to a table.

15. Which SQL statement is used to retrieve data from a database?

  1. GET
  2. FETCH
  3. SELECT
  4. SHOW

Answer: SELECT

The SELECT statement is used to retrieve data from one or more tables.

16. Which SQL clause is used to filter records based on a condition?

  1. ORDER BY
  2. WHERE
  3. GROUP BY
  4. HAVING

Answer: WHERE

The WHERE clause filters rows that satisfy a specified condition.

17. Which SQL clause is used to sort query results?

  1. GROUP BY
  2. ORDER BY
  3. WHERE
  4. SORT

Answer: ORDER BY

ORDER BY sorts the result set in ascending (ASC) or descending (DESC) order.

18. Which SQL clause is used to group rows that have the same values?

  1. WHERE
  2. GROUP BY
  3. ORDER BY
  4. JOIN

Answer: GROUP BY

GROUP BY groups rows with the same values, often used with aggregate functions.

19. Which SQL operation combines rows from two or more tables based on a related column?

  1. MERGE
  2. JOIN
  3. UNION
  4. CONNECT

Answer: JOIN

JOIN is used to retrieve related data from multiple tables.

20. Which SQL function returns the total number of rows in a result set?

  1. SUM()
  2. AVG()
  3. COUNT()
  4. MAX()

Answer: COUNT()

COUNT() returns the number of rows or non-NULL values in a column.

Take the timed quiz