CompTIA certification · Exam DS0-001

DS0-001 Mock Exam Page 4

CompTIA DataSys+

Free DS0-001 mock exam questions 31–36, each with the answer and an explanation.

20 questions · 20 minutes · free, no sign-up

Free DS0-001 questions

31–36 of 36 free
Question 31 Choose 1
Which of the following constraints is used to enforce referential integrity?
Show answerHide answer

Correct answer: B Foreign key

Explanation

Explanation:

A foreign key is the constraint specifically designed to enforce referential integrity between two tables. It ensures that values in a column (or columns) in one table match values in the primary key or unique key column of another table (or the same table). This maintains consistency by preventing actions that would orphan records or create invalid links.

Why other options are incorrect:

A. Surrogate key:
Incorrect. A surrogate key is an artificial primary key (often an auto-incrementing number) with no business meaning. It does not enforce relationships between tables.

C. Unique key:
Incorrect. A unique key constraint ensures all values in a column (or set of columns) are distinct (except NULLs), but it does not define relationships between tables.

D. Primary key:
Incorrect. A primary key uniquely identifies each row within its own table. While foreign keys often reference primary keys, the primary key itself does not enforce referential integrity.

Reference:
CompTIA DataSys+ DS0-001 Objective 1.3: "Given a scenario, create and modify database objects using scripts and SQL." This includes understanding constraints, particularly foreign keys for maintaining referential integrity.
Question 32 Choose 1
Following a security breach, a database administrator needs to ensure users cannot change data unless a request is approved by the management team. Which of the following principles addresses this issue?
Show answerHide answer

Correct answer: D Least privilege

Explanation

Explanation:

The principle of least privilege states that users should be granted only the minimum level of access necessary to perform their job functions. In this scenario, the administrator needs to ensure users cannot change data without management approval, which means users should not have write/update privileges by default. This aligns perfectly with least privilege—users would need their privileges temporarily elevated (through an approved request) to perform data changes.

Why other options are incorrect:

A. Open access:
Incorrect. Open access would mean unrestricted access to data, which is the opposite of what the administrator needs to implement after a security breach.

B. Least resistance:
Incorrect. "Least resistance" is not a recognized security principle. It generally refers to making things easy for users, which conflicts with security requirements.

C. Elevated privilege:
Incorrect. Elevated privilege refers to temporarily granting higher access levels, which might be part of the approval process but is not the underlying principle preventing unauthorized changes.

Reference:
CompTIA DataSys+ DS0-001 Objective 4.2: "Given a scenario, implement and configure database security controls." This includes understanding the principle of least privilege for access control and authorization.
Question 33 Choose 1
Which of the following sets the age requirement for data that should be recovered after a major disaster?
Show answerHide answer

Correct answer: D RPO

Explanation

Explanation:

Recovery Point Objective (RPO) defines the maximum acceptable age of data that must be recovered after a disaster. It answers the question: "How much data can we afford to lose?" For example, an RPO of 24 hours means data can be no older than 24 hours at recovery time, requiring at least daily backups. This directly matches the scenario's "age requirement for data that should be recovered."

Why other options are incorrect:

A. MTBF (Mean Time Between Failures):
Incorrect. MTBF measures the average time between system failures, indicating reliability. It does not relate to data recovery age requirements.

B. RTO (Recovery Time Objective):
Incorrect. RTO defines the maximum acceptable downtime after a disaster—how quickly systems must be restored. It addresses time to recovery, not data age.

C. MTTF (Mean Time To Failure):
Incorrect. MTTF measures the average time until a non-repairable system fails. Like MTBF, it's a reliability metric, not a data recovery requirement.

Reference:
CompTIA DataSys+ DS0-001 Objective 5.1: "Explain the purpose and importance of business continuity and disaster recovery concepts." This includes understanding RPO and RTO as key recovery metrics.
Question 34 Choose 1
Given the following customer table:

Which of the following ORM snippets would return the ID, state, and country of all customers with the newest customers appearingfirst?
Show answerHide answer

Correct answer: B Option B

Explanation

Explanation:

Option B correctly uses order_by() with desc() to sort results in descending order based on First_Purchase_Date. When "newest customers" should appear first, this means customers with the most recent (largest/highest) first purchase date should be at the top of the result set. Descending order (desc()) accomplishes this by placing the most recent dates first.

The syntax order_by(Customer.First_Purchase_Date.desc()) is proper ORM (likely SQLAlchemy) syntax for descending sorting.

Why other options are incorrect:

A. Option A: Incorrect. This uses asc() (ascending order), which would show the oldest customers first (smallest/earliest dates), the opposite of what is requested.

C. Option C: Incorrect. This has no order_by clause at all, so results would be returned in arbitrary order (typically based on database internal storage), not with newest customers first.

D. Option D: Incorrect. This uses order_by without specifying ascending or descending. The default behavior varies by ORM/database but typically defaults to ascending order, which would show oldest customers first.

Reference:
CompTIA DataSys+ DS0-001 Objective 3.2: "Compare and contrast different data movement strategies." This includes understanding how to query and sort data using programming languages and ORM frameworks.
Question 35 Choose 1
Which of the following is thebestway to migrate a large data load from one table to another, considering total time and blocking?
Show answerHide answer

Correct answer: C Batch into small loads and run in parallel.

Explanation

Explanation:

Batching data into smaller chunks and running them in parallel is the optimal strategy for large data migrations when considering both total time and blocking. This approach:

Minimizes blocking: Small transactions hold locks for shorter periods, reducing the impact on concurrent database users

Reduces total time: Parallel execution processes multiple batches simultaneously, completing the migration faster than sequential processing

Provides better manageability: Small batches are easier to monitor, restart if failures occur, and tune individually

Prevents transaction log overflow: Large transactions can fill transaction logs; smaller batches keep log usage manageable

Why other options are incorrect:

A. Split the load size into many transactions:
Incorrect. While splitting into smaller transactions reduces blocking, running them sequentially (implied by not specifying parallel) would significantly increase total migration time.

B. Split the load size in half and run simultaneously:
Incorrect. Only two parallel streams limits parallelism benefits. Also, halves may still be too large, causing blocking and log issues.

D. Batch large loads into one transaction:
Incorrect. This is the worst approach—a single massive transaction causes prolonged blocking, potential transaction log exhaustion, and complete failure if anything goes wrong mid-process.

Reference:
CompTIA DataSys+ DS0-001 Objective 3.2: "Compare and contrast different data movement strategies." This includes optimizing large data migrations by balancing transaction size, concurrency, and performance impact.
Question 36 Choose 1
Which of the following commands is part of DDL?
Show answerHide answer

Correct answer: C CREATE

Explanation

Explanation:

CREATE is a Data Definition Language (DDL) command. DDL commands are used to define, modify, and remove database structures and objects, not to manipulate the data within them. CREATE specifically is used to create new database objects such as tables, views, indexes, schemas, and databases.

Categories of SQL Commands:
DDL (Data Definition Language): CREATE, ALTER, DROP, TRUNCATE, RENAME
DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE
DCL (Data Control Language): GRANT, REVOKE

Why other options are incorrect:

A. UPDATE: Incorrect. UPDATE is a DML command used to modify existing data within tables.

B. GRANT: Incorrect. GRANT is a DCL command used to give privileges and access rights to users.

D. INSERT: Incorrect. INSERT is a DML command used to add new rows of data to tables.

Reference:
CompTIA DataSys+ DS0-001 Objective 1.3: "Given a scenario, create and modify database objects using scripts and SQL." This includes understanding the different categories of SQL commands, particularly DDL for creating database structures.

That's the last free question

You've seen the free 30% (36 of 120 questions). Full access unlocks every question and full-length DS0-001 mock exams (90 questions, 90 minutes), a different mock on every attempt.

Unlock full mock exam
Full mock exam

Sit the DS0-001 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DS0-001 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DS0-001 mock exam
  • 90questions per mock
  • 90 mintime limit
  • 120questions in the bank
  • Newmock on every attempt