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
- Relational model and keys
- Normalisation
- SQL basics
- Transactions and ACID
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?
- Database Management System
- Data Backup Management System
- Database Memory System
- 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?
- MySQL
- Google Chrome
- Windows
- MS Word
Answer: MySQL
MySQL is a popular relational database management system.
3. What is a database?
- A programming language
- A collection of related data
- A compiler
- 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?
- Relational Database
- Hierarchical Database
- Network Database
- 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?
- HTML
- Java
- SQL
- 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?
- To store duplicate values
- To uniquely identify each record in a table
- To connect two databases
- 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:
- Delete records
- Create indexes
- Establish a relationship between two tables
- 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?
- Foreign Key
- Candidate Key
- Composite Key
- 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?
- A key made from multiple tables
- A key consisting of two or more columns
- A duplicate key
- 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?
- Foreign Key
- Primary Key
- Super Key
- 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?
- To increase data redundancy
- To reduce data redundancy and improve data integrity
- To create more tables unnecessarily
- 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)?
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)
- 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?
- INSERT
- CREATE TABLE
- UPDATE
- 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?
- SELECT
- UPDATE
- INSERT INTO
- 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?
- GET
- FETCH
- SELECT
- 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?
- ORDER BY
- WHERE
- GROUP BY
- HAVING
Answer: WHERE
The WHERE clause filters rows that satisfy a specified condition.
17. Which SQL clause is used to sort query results?
- GROUP BY
- ORDER BY
- WHERE
- 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?
- WHERE
- GROUP BY
- ORDER BY
- 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?
- MERGE
- JOIN
- UNION
- 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?
- SUM()
- AVG()
- COUNT()
- MAX()
Answer: COUNT()
COUNT() returns the number of rows or non-NULL values in a column.