CompTIA ITF+ Database Fundamentals Questions and Answers — Questions and Answers
Question 1: A small business owner wants to store customer information, including names, addresses, and purchase histories. They need a system that can manage relationships between customers and their orders efficiently and reduce data redundancy. Which of the following would be the MOST suitable solution?
- A flat-file database, like a single spreadsheet.
- A word processing document for each customer.
- A relational database. (Correct answer)
- A presentation software with a slide for each customer.
Correct answer: A relational database.
A relational database is the best choice because it is designed to manage structured data and the relationships between different data sets (like customers and orders). It uses tables with keys to link information, which minimizes data redundancy and improves data integrity, unlike a flat-file system which stores data in a single table and can lead to repetition and inconsistencies.
Question 2: In a relational database table for employees, each employee is assigned a unique 'EmployeeID' number that is never duplicated. What is the database term for this type of field?
- Foreign Key
- Record
- Schema
- Primary Key (Correct answer)
Correct answer: Primary Key
A Primary Key is a field in a database table that uniquely identifies each record or row. The 'EmployeeID' serves this purpose, as it provides a unique identifier for every employee, ensuring no two records are the same and that each can be reliably referenced.
Question 3: Which of the following is a standard language specifically designed for managing and querying data in a relational database?
- HTML
- Python
- SQL (Correct answer)
- Java
Correct answer: SQL
SQL (Structured Query Language) is the standard domain-specific language used to communicate with and manage data within relational database management systems (RDBMS). It is used for tasks like retrieving, inserting, updating, and deleting data.
Question 4: A database table contains information about students. One column in the table stores each student's first name. What is this single column, which represents one piece of information about each student, called?
- A record
- A field (Correct answer)
- A database
- A query
Correct answer: A field
A field (or column) is a single piece of data within a record. In this case, 'first name' is an attribute of a student, so the column containing all first names is a field. A record (or row) represents a complete set of fields for a single entity (e.g., all information for one student).
Question 5: A database has a 'Customers' table with a `CustomerID` as the primary key. It also has an 'Orders' table that needs to associate each order with a specific customer. To do this, a `CustomerID` column is added to the 'Orders' table. What is the `CustomerID` column in the 'Orders' table considered?
- A Primary Key
- An Alternate Key
- A Foreign Key (Correct answer)
- A Super Key
Correct answer: A Foreign Key
A Foreign Key is a column or a set of columns in one table that refers to the primary key of another table. In this scenario, the `CustomerID` in the 'Orders' table is a foreign key because it links an order record to a specific customer record in the 'Customers' table, enforcing referential integrity.
Question 6: A database administrator is designing a table to store product inventory. One of the columns will hold the quantity of each product in stock. Which of the following data types would be MOST appropriate for this 'Quantity' column?
- String
- Boolean
- Date/Time
- Integer (Correct answer)
Correct answer: Integer
An Integer (INT) data type is used to store whole numbers. Since the quantity of a product is a whole number (e.g., 10, 50, 200), Integer is the most appropriate and efficient data type. String is for text, Boolean is for true/false values, and Date/Time is for calendar and time information.
A small business owner wants to store customer information, including names, addresses, and purchase histories.
They need a system that can manage relationships between customers and their orders efficiently and reduce data redundancy.
Which of the following would be the MOST suitable solution?