CompTIA DataSys+ DS0-001 Practice Test Questions and Exam Dumps Part8 Q141-160

View Full CompTIA DataSys+ DS0-001 Exam Dumps and Practice Test Dumps

 

Question 141.

A database administrator wants to identify rows that appear in one table but have no matching row in another related table. Which approach is MOST appropriate?

  1. Use an outer join and filter for unmatched rows
  2. Use only ORDER BY
  3. Use a CROSS JOIN
  4. Use TRUNCATE

Correct Answer: 1. Use an outer join and filter for unmatched rows

Explanation:

An outer join can return rows from one table even when no matching row exists in the related table. Filtering for NULL values on the unmatched side is a common way to identify missing relationships, such as customers without orders. A CROSS JOIN produces all combinations of rows, while ORDER BY only sorts results and TRUNCATE removes data.

Question 142.

Which SQL function category is used to calculate values such as average, minimum, maximum, and total across multiple rows?

  1. String functions
  2. Aggregate functions
  3. Conversion functions
  4. Date formatting functions

Correct Answer: 2. Aggregate functions

Explanation:

Aggregate functions summarize sets of rows. Common examples include AVG, MIN, MAX, SUM, and COUNT. They are often combined with GROUP BY to calculate values for categories such as departments, customers, or dates. Aggregate functions are useful in reporting, trend analysis, and operational monitoring where summarized information is needed instead of individual row details.

Question 143.

A database administrator needs to return the highest value in a Salary column. Which SQL function is MOST appropriate?

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

Correct Answer: 3. MAX

Explanation:

MAX returns the highest value in a selected column. It can be used with numeric, date, and some other comparable data types depending on the database platform. COUNT returns the number of rows or values, AVG calculates an average, and SUM calculates a total. MAX is therefore appropriate for finding the highest salary.

Question 144.

Which SQL function would BEST return the total value of all sales amounts in a result set?

  1. MIN
  2. COUNT
  3. AVG
  4. SUM**

Correct Answer: 4. SUM

Explanation:

SUM adds numeric values across the selected rows and is commonly used for totals such as revenue, quantity, or cost. It can also be grouped to calculate subtotals for departments, customers, or periods. COUNT returns row counts, AVG returns an average, and MIN returns the smallest value.

Question 145.

A database column contains repeating values that are frequently searched, but each value appears in a large percentage of the table. What should the administrator consider before creating an index?

  1. The column’s selectivity and whether the optimizer would benefit from the index
  2. The number of database users only
  3. The backup retention period
  4. The database server hostname

Correct Answer: 1. The column’s selectivity and whether the optimizer would benefit from the index

Explanation:

Columns with very few distinct values may have low selectivity, meaning an index might not significantly reduce the number of rows read. In some workloads, a scan may be more efficient. The administrator should review query patterns, data distribution, and execution plans before adding the index. Index usefulness depends on workload rather than the mere fact that a column is searched.

Question 146.

What is the PRIMARY purpose of database statistics used by a query optimizer?

  1. Store user passwords
  2. Help estimate data distribution and row counts so efficient execution plans can be chosen
  3. Replace backups
  4. Encrypt table contents

Correct Answer: 2. Help estimate data distribution and row counts so efficient execution plans can be chosen

Explanation:

Optimizer statistics describe properties such as row counts, value distribution, and cardinality. The database uses this information to estimate the cost of possible execution strategies. If statistics become stale or inaccurate, the optimizer may choose inefficient plans. Maintaining current statistics is therefore an important part of database performance management.

Question 147.

A database administrator wants to identify whether a query repeatedly recompiles rather than reusing an efficient execution plan. Which area should be investigated?

  1. Backup encryption
  2. User onboarding
  3. Plan cache and query compilation behavior
  4. Table naming standards

Correct Answer: 3. Plan cache and query compilation behavior

Explanation:

Many database systems cache execution plans so repeated queries can avoid unnecessary compilation overhead. Frequent recompilation may increase CPU usage and reduce performance. Administrators should review plan-cache behavior, parameterization, schema changes, statistics updates, and query patterns to determine why plans are not being reused appropriately.

Question 148.

A database workload has many repeated read queries against the same relatively static data. Which technique MAY improve performance if supported and appropriate?

  1. Delete indexes
  2. Disable memory caching
  3. Increase transaction length
  4. Use caching or a suitable materialized result mechanism**

Correct Answer: 4. Use caching or a suitable materialized result mechanism

Explanation:

Caching frequently requested data can reduce repeated database work when the underlying information changes infrequently and freshness requirements permit it. Materialized views or application caches may also help with expensive reporting queries. The design must account for invalidation and data freshness so users do not receive stale results beyond acceptable limits.

Question 149.

Which database concept describes the number of distinct values in a column relative to the number of rows?

  1. Selectivity
  2. Durability
  3. Replication
  4. Atomicity

Correct Answer: 1. Selectivity

Explanation:

Selectivity reflects how effectively a predicate or indexed column can narrow a result set. Highly selective columns have many distinct values and can often benefit from indexing for equality searches. Low-selectivity columns contain relatively few distinct values, which may make some indexes less useful. Selectivity is an important factor in query optimization.

Question 150.

A database administrator wants to prevent a query from returning more rows than an application can safely process at once. Which design is MOST appropriate?

  1. Remove the WHERE clause
  2. Use controlled pagination or a row-limit mechanism
  3. Grant more privileges
  4. Disable indexes

Correct Answer: 2. Use controlled pagination or a row-limit mechanism

Explanation:

Pagination and row-limiting mechanisms prevent applications from retrieving excessively large result sets in one request. This reduces memory, network, and processing overhead. The exact syntax varies by database platform, but the general approach is to retrieve manageable batches in a predictable order rather than requesting an entire large table at once.

Question 151.

A company requires that deleted customer records remain recoverable for 30 days. Which operational capability BEST supports this requirement?

  1. Permanent hard deletion immediately
  2. Disable backups after deletion
  3. Backup, archive, or controlled soft-delete mechanisms aligned with retention policy
  4. Drop the database weekly

Correct Answer: 3. Backup, archive, or controlled soft-delete mechanisms aligned with retention policy

Explanation:

Recovery requirements should be implemented through appropriate retention, archival, backup, or soft-delete strategies. The selected design should allow records to be restored for the required period while still meeting privacy and disposal requirements after that period expires. The exact method depends on business rules, storage architecture, and regulatory obligations.

Question 152.

A database contains sensitive records that should become unreadable after a cryptographic key is retired. Which concept is MOST directly involved?

  1. Index rebuilding
  2. Query caching
  3. Normalization
  4. Encryption key lifecycle management**

Correct Answer: 4. Encryption key lifecycle management

Explanation:

Encrypted data depends on the availability and protection of the corresponding keys. Key lifecycle management includes creation, storage, rotation, backup, access control, expiration, revocation, and destruction. If keys are lost prematurely, legitimate recovery may become impossible. If old keys remain improperly accessible, supposedly retired data may still be recoverable.

Question 153.

Which practice BEST supports secure handling of database encryption keys?

  1. Store keys in a protected key-management system separate from the encrypted data
  2. Store keys in the same public directory as the database files
  3. Email keys to administrators
  4. Hard-code keys into application source code

Correct Answer: 1. Store keys in a protected key-management system separate from the encrypted data

Explanation:

Encryption is effective only when the associated keys are protected. A dedicated key-management system or hardware-backed mechanism can provide controlled access, rotation, auditing, and secure storage. Keeping keys separate from encrypted database files reduces the chance that a single compromise exposes both the protected data and the means to decrypt it.

Question 154.

A database administrator needs to determine whether unusual privileged activity occurred overnight. Which data source should be reviewed FIRST?

  1. Index fragmentation report
  2. Database audit and authentication logs
  3. Query result formatting
  4. Backup compression ratio

Correct Answer: 2. Database audit and authentication logs

Explanation:

Audit and authentication logs can show privileged logins, permission changes, schema modifications, and access to sensitive objects. Reviewing this information helps administrators determine who performed actions and when. Logs should be protected from tampering and synchronized to reliable time sources so event timelines remain trustworthy during investigations.

Question 155.

A database server is receiving thousands of failed authentication attempts from one source. What is the BEST immediate response?

  1. Disable all auditing
  2. Grant the source a valid account
  3. Investigate and apply appropriate access controls or blocking while preserving evidence
  4. Delete authentication logs

Correct Answer: 3. Investigate and apply appropriate access controls or blocking while preserving evidence

Explanation:

Repeated authentication failures may indicate a brute-force attempt, misconfigured service, or compromised system. Administrators should preserve logs, investigate the source, and apply appropriate controls such as blocking, rate limiting, account protection, or network restrictions according to incident-response procedures. Deleting evidence or disabling auditing would make investigation more difficult.

Question 156.

Which control BEST limits the impact if an application’s database credentials are compromised?

  1. Grant full administrative permissions
  2. Use the same account for every application
  3. Disable access logging
  4. Apply least privilege to the application account**

Correct Answer: 4. Apply least privilege to the application account

Explanation:

Least privilege limits an application account to only the database actions and objects it actually needs. If the credentials are compromised, the attacker’s capabilities are therefore constrained. Additional protections include credential rotation, network restrictions, monitoring, and secure secrets management. Excessive privileges dramatically increase the potential impact of credential theft.

Question 157.

Which practice BEST helps protect database services from unauthorized network access?

  1. Restrict network connectivity to approved hosts, applications, or subnets
  2. Expose the database port publicly for convenience
  3. Use one shared password for all clients
  4. Disable TLS

Correct Answer: 1. Restrict network connectivity to approved hosts, applications, or subnets

Explanation:

Network access controls reduce database exposure by allowing connections only from authorized systems or network segments. Firewalls, security groups, private networks, and similar controls can limit attack surface. These controls should be combined with strong authentication, encryption in transit, least privilege, and monitoring rather than used as the sole security mechanism.

Question 158.

A company wants to separate production database administration from application development. Which control BEST supports this goal?

  1. Shared production passwords
  2. Separation of duties
  3. Anonymous database access
  4. Disabling change records

Correct Answer: 2. Separation of duties

Explanation:

Separation of duties reduces risk by assigning different sensitive responsibilities to different people or teams. Developers may design and test changes, while authorized database administrators deploy them to production under controlled procedures. This reduces the likelihood of unauthorized or unreviewed modifications and complements least privilege, change management, and auditing.

Question 159.

A database administrator needs to verify that database permissions still match employee responsibilities. Which activity is MOST appropriate?

  1. Rebuild all indexes
  2. Increase storage capacity
  3. Conduct a periodic access review
  4. Truncate temporary tables

Correct Answer: 3. Conduct a periodic access review

Explanation:

Periodic access reviews compare current permissions with users’ actual roles and business needs. They help identify outdated, excessive, or unnecessary privileges caused by transfers, promotions, or project changes. Access reviews support least privilege and should include direct permissions, role memberships, privileged accounts, and service identities where appropriate.

Question 160.

Which statement BEST describes effective database security administration?

  1. Security ends once strong passwords are configured
  2. All users should receive broad access to simplify support
  3. Database security is primarily a backup function
  4. Security requires ongoing access control, encryption, monitoring, auditing, patching, and review**

Correct Answer: 4. Security requires ongoing access control, encryption, monitoring, auditing, patching, and review

Explanation:

Database security is a continuous operational responsibility. Administrators must manage identities and permissions, protect sensitive data at rest and in transit, monitor suspicious activity, maintain audit records, patch vulnerabilities, secure backups, and periodically review controls. Security requirements change as systems and business needs evolve, so controls must be reassessed rather than configured once and forgotten.