Courseiva

CCNA Data Acquisition and Preparation Questions

58 of 208 questions · Page 3/3 · Data Acquisition and Preparation · Answers revealed

151
MCQmedium

An analyst is reviewing the above SQL query used to acquire data. What does this query retrieve?

A.Customers who placed more than 5 orders in 2023
B.All customers who placed at least 5 orders in 2023
C.The total number of orders per customer in 2023
D.Customers who placed exactly 5 orders in 2023
AnswerA

The HAVING clause filters for counts greater than 5.

Why this answer

The SQL query uses a HAVING clause with COUNT(*) > 5 to filter customers who placed more than 5 orders in 2023. The WHERE clause restricts records to the year 2023, and the GROUP BY customer_id aggregates orders per customer. The condition '> 5' explicitly excludes customers with exactly 5 or fewer orders, making option A correct.

Exam trap

The trap here is confusing the comparison operator '>' with '>=', leading candidates to mistakenly include customers with exactly 5 orders when the query explicitly excludes them.

How to eliminate wrong answers

Option B is wrong because 'at least 5 orders' would require the condition COUNT(*) >= 5, not > 5. Option C is wrong because the query returns customer IDs, not the total number of orders per customer; the COUNT is used only for filtering, not as a selected column. Option D is wrong because 'exactly 5 orders' would require COUNT(*) = 5, not > 5.

152
MCQmedium

A dataset contains sales transactions with columns 'order_date', 'amount', and 'region'. The analyst wants to calculate the total sales per region for orders placed in 2023, but only include regions where total sales exceed $10,000. Which SQL clause should be used to filter the aggregated results?

A.HAVING
B.WHERE
C.GROUP BY
D.FILTER
AnswerA

HAVING filters aggregated results after GROUP BY.

Why this answer

The HAVING clause filters groups after aggregation, whereas WHERE filters rows before grouping.

153
MCQeasy

A data analyst wants to retrieve the top 5 highest-paid employees from a table named 'employees' that has columns 'employee_id', 'salary', and 'name'. Which SQL query should they use?

A.SELECT TOP 5 name, salary FROM employees ORDER BY salary DESC;
B.SELECT name, salary FROM employees ORDER BY salary DESC LIMIT 5;
C.SELECT name, salary FROM employees ORDER BY salary ASC LIMIT 5;
D.SELECT name, salary FROM employees WHERE ROWNUM <= 5 ORDER BY salary DESC;
AnswerB

Correct syntax.

Why this answer

ORDER BY salary DESC sorts from highest to lowest, and LIMIT 5 restricts to the first 5 rows.

154
Multi-Selectmedium

A data analyst is reviewing a dataset of customer transactions and wants to assess data quality by profiling the 'order_date' column. Which TWO profiling tasks are most appropriate for this date column? (Select TWO).

Select 2 answers
A.Pattern analysis (e.g., format consistency)
B.Count of null values
C.Variance
D.Cardinality (number of unique values)
E.Data type verification
AnswersB, E

Null count is a standard profiling check for any column.

Why this answer

Profiling a date column typically includes checking for null values and verifying the data type. Cardinality and pattern analysis are more relevant for categorical or string columns; variance is for numeric data.

155
MCQmedium

A data analyst uses a CTE to simplify a complex query. Which keyword is used to define a CTE?

A.DEFINE
B.CTE
C.DECLARE
D.WITH
AnswerD

CTEs are defined using the WITH keyword.

Why this answer

The WITH clause introduces a CTE.

156
MCQhard

An analyst writes a SQL query that uses a window function: SELECT employee_id, salary, LAG(salary, 1) OVER (ORDER BY salary DESC) AS prev_salary FROM employees. What does the LAG function return for the row with the highest salary?

A.The same salary value
B.NULL
C.The next highest salary
D.Zero
AnswerB

LAG returns NULL if there is no preceding row.

Why this answer

LAG returns the previous row's value in the ordered partition. For the first row (highest salary), there is no previous row, so it returns NULL.

157
MCQmedium

An analyst is sampling a large customer database to estimate the average purchase amount. To ensure that the sample proportionally represents different customer segments (e.g., age groups), which sampling method should be used?

A.Systematic sampling
B.Simple random sampling
C.Cluster sampling
D.Stratified sampling
AnswerD

Stratified sampling ensures proportional representation from each stratum.

Why this answer

Stratified sampling divides the population into strata (e.g., age groups) and samples proportionally from each stratum.

158
Multi-Selectmedium

A company is acquiring social media data via a public API. Which TWO considerations are important for ensuring ethical and legal compliance?

Select 2 answers
A.Share raw data with third parties for additional insights
B.Use the data for any internal analysis without restrictions
C.Anonymize personal identifiable information (PII) before storage
D.Cache data indefinitely to avoid repeated API calls
E.Comply with the platform's terms of service
AnswersC, E

Anonymization protects individual privacy and complies with regulations.

Why this answer

Anonymizing PII before storage is a fundamental data privacy requirement under regulations like GDPR and CCPA. When acquiring data via a public API, the company must ensure that personal identifiers (e.g., names, email addresses, IP addresses) are removed or obfuscated to prevent re-identification, reducing legal liability and ethical risk.

Exam trap

The trap here is that candidates may confuse 'caching for efficiency' (Option D) with ethical compliance, overlooking that indefinite storage violates data minimization principles and platform terms, while 'internal analysis' (Option B) seems harmless but ignores explicit usage restrictions in the API's terms of service.

159
MCQhard

Refer to the exhibit. What is the most likely cause of the extraction failure?

A.The source table is locked
B.The network firewall is blocking the port
C.The extraction query is too complex
D.The database server is down
AnswerB

Causes connection to hang until timeout.

Why this answer

Connection timeouts with consistent 30-second delays suggest the network firewall is blocking the port, causing the connection to hang until timeout. Option A is wrong because if the server were down, the error would be connection refused immediately. Option C is wrong because a complex query would cause a slow query, not a connection timeout.

Option D is wrong because a locked table would cause a lock wait timeout, not a connection timeout.

160
Multi-Selectmedium

A data analyst needs to identify duplicate customer records. Which TWO methods are commonly used? (Select two.)

Select 2 answers
A.Fuzzy matching using Levenshtein distance
B.Sorting and comparing adjacent rows
C.Visual inspection of random sample
D.Using a hash function on primary key
E.Exact match on all fields
AnswersA, B

Levenshtein distance catches spelling differences.

Why this answer

Fuzzy matching using Levenshtein distance (Option A) is correct because it measures the edit distance between two strings, allowing identification of duplicates even when there are minor typographical differences, such as 'Jon Smith' vs. 'John Smith'. This is essential for deduplicating customer records where names, addresses, or other fields may have slight variations without being exact matches.

Exam trap

The trap here is that candidates often choose 'Exact match on all fields' (Option E) thinking it is a reliable deduplication method, but in practice it fails to catch real-world duplicates that have any minor variation, and the exam expects you to recognize that fuzzy matching and sorted adjacency comparisons are the standard techniques for duplicate detection.

161
Multi-Selecthard

An analyst is using a CTE to compute hierarchical data. Which TWO statements about recursive CTEs are true?

Select 2 answers
A.The recursive member must reference the CTE name
B.The anchor member is the first SELECT that does not reference the CTE
C.Recursive CTEs can only be used for numerical sequences
D.Recursive CTEs must include a UNION ALL operator
E.Recursive CTEs cannot be used with GROUP BY
AnswersA, B

Correct. The recursive member must reference the CTE name; this defines the recursion.

Why this answer

Recursive CTEs consist of an anchor member (initial SELECT) that does not reference the CTE, making option B correct. The recursive member must reference the CTE name, as stated in option A. While UNION ALL is commonly used, it is not a strict requirement; some implementations allow alternative set operators, so option D is not universally true.

Options C and E are false: recursive CTEs handle hierarchies beyond numerical sequences and can be used with GROUP BY.

162
MCQeasy

A data analyst receives the above JSON snippet from a web API. The analyst needs to extract the email addresses for all customers. Which JSONPath expression should be used?

A.$.customers[0].email
B.$..email
C.$.customers[*].email
D.$.customers.email
AnswerC

This expression selects email from every customer object.

Why this answer

The JSONPath expression `$.customers[*].email` uses the wildcard `[*]` to select all elements in the `customers` array and then accesses the `email` property of each element. This matches the requirement to extract email addresses for all customers from the JSON snippet.

Exam trap

The trap here is that candidates often confuse the deep scan operator `..` with the array wildcard `[*]`, thinking `$..email` will neatly extract all customer emails, but it actually retrieves every `email` property at any depth, including from non-customer objects, leading to incorrect data extraction.

How to eliminate wrong answers

Option A is wrong because `$.customers[0].email` only retrieves the email address of the first customer in the array, not all customers. Option B is wrong because `$..email` uses the deep scan operator `..` which recursively searches the entire JSON tree for any property named `email`, potentially returning emails from nested objects or arrays that are not customers (e.g., from an `orders` or `address` object), leading to incorrect or extra results. Option D is wrong because `$.customers.email` attempts to access `email` directly on the `customers` array object, but arrays in JSONPath do not have a property named `email`; this expression would return `null` or an empty result unless the array itself has an `email` property, which it does not.

163
Multi-Selecthard

A data analyst is using a recursive CTE to traverse a hierarchical organizational chart. Which THREE components are required to define a recursive CTE? (Select THREE.)

Select 3 answers
A.ORDER BY clause
B.Anchor member
C.WITH clause
D.Recursive member
E.UNION ALL operator
AnswersB, D, E

The anchor member defines the initial result set.

Why this answer

A recursive CTE requires an anchor member (initial query), a recursive member (that references the CTE itself), and the UNION ALL operator to combine them. The WITH clause is the outer syntax, not part of the recursion itself.

164
MCQeasy

A data team needs to extract data from a legacy system that only supports flat file exports. Which data acquisition method is most appropriate?

A.Database replication
B.API call
C.Web scraping
D.File transfer via SFTP
AnswerD

SFTP enables secure transfer of flat files, aligning with the system's export capability.

Why this answer

The legacy system only supports flat file exports, meaning it cannot provide direct database or API access. SFTP (SSH File Transfer Protocol) is the most appropriate method because it securely transfers flat files over a network, aligning with the system's export capabilities while ensuring data integrity and encryption during transit.

Exam trap

The trap here is that candidates may confuse 'flat file exports' with a need for real-time or API-based methods, overlooking that SFTP is the standard secure file transfer protocol for batch-oriented legacy systems.

How to eliminate wrong answers

Option A is wrong because database replication requires the source system to support a database engine with replication features (e.g., transactional logs or CDC), which a legacy flat-file-only system lacks. Option B is wrong because an API call requires the legacy system to expose a programmatic interface (e.g., REST or SOAP), which is not available if it only supports flat file exports. Option C is wrong because web scraping is used to extract data from web pages via HTTP, not from a legacy system that exports flat files via a file transfer protocol.

165
MCQhard

A data analyst needs to perform stratified sampling on a customer database to ensure proportional representation across three regions: North (40%), South (30%), and West (30%). The total sample size required is 1,000. How many customers should be sampled from the North region?

A.333
B.500
C.300
D.400
AnswerD

Correct: 40% of 1000.

Why this answer

Stratified sampling with proportional allocation: sample size per stratum = (stratum proportion) * total sample size. North = 0.40 * 1000 = 400.

166
MCQhard

A data analyst needs to create a recursive CTE to traverse a hierarchical employee-manager table. Which of the following is a key requirement for a recursive CTE?

A.The CTE must include a WHERE clause in the recursive member
B.The CTE must use the RECURSIVE keyword in the WITH clause
C.The recursive CTE must have at least one anchor member that does not reference the CTE
D.The recursive member must use UNION instead of UNION ALL
AnswerC

The anchor member provides the starting set; the recursive member references the CTE.

Why this answer

A recursive CTE must have an anchor member (non-recursive) and a recursive member that references the CTE name, connected by UNION ALL.

167
MCQhard

A data analyst discovers that a dataset contains multiple records for the same customer with different spellings (e.g., 'Jon' vs 'John'). Which data preparation step should be applied first?

A.Merge all records into one per customer.
B.Remove duplicates based on exact match.
C.Standardize text fields using a lookup table.
D.Flag records for manual review.
AnswerC

Standardization harmonizes variations like 'Jon' and 'John'.

Why this answer

The first step when dealing with inconsistent text values (like 'Jon' vs 'John') is to standardize the data using a lookup table or reference mapping. This ensures that all variations are normalized to a canonical form before any merging or deduplication is attempted, preventing data loss and preserving referential integrity.

Exam trap

The trap here is that candidates often jump to 'remove duplicates' (Option B) because they think of exact-match deduplication, but the question specifically tests the understanding that data quality issues like inconsistent spellings must be resolved through standardization before any deduplication logic can be applied.

How to eliminate wrong answers

Option A is wrong because merging records before standardizing spellings would combine data based on non-uniform keys, likely creating erroneous composite records or losing the ability to correctly identify which records belong to the same customer. Option B is wrong because removing duplicates based on exact match would treat 'Jon' and 'John' as different records, failing to identify them as the same customer and leaving the inconsistency unresolved. Option D is wrong because flagging records for manual review is a downstream action that should only be taken after automated standardization has been attempted; skipping standardization first would result in an unnecessarily large and inefficient manual review workload.

168
MCQeasy

A data analyst is using SQL to extract data. The analyst wants to retrieve all records from a table named 'sales' where the 'amount' column is greater than 100. Which SQL clause should be used?

A.WHERE
B.ORDER BY
C.GROUP BY
D.HAVING
AnswerA

WHERE clause filters rows based on a condition.

Why this answer

The WHERE clause in SQL is used to filter records based on a specified condition, such as 'amount > 100'. It is applied directly to the rows in the 'sales' table before any grouping or ordering, making it the correct choice for retrieving only records where the amount exceeds 100.

Exam trap

The trap here is that candidates often confuse HAVING with WHERE, thinking both can filter rows, but HAVING is only valid after GROUP BY and for aggregate conditions, while WHERE filters individual rows before any grouping.

How to eliminate wrong answers

Option B (ORDER BY) is wrong because it is used to sort the result set by one or more columns, not to filter rows based on a condition. Option C (GROUP BY) is wrong because it groups rows that have the same values in specified columns into summary rows, often for use with aggregate functions, and does not filter individual records. Option D (HAVING) is wrong because it is used to filter groups after the GROUP BY clause has been applied, typically with aggregate functions, and cannot be used to filter individual rows before grouping.

169
MCQmedium

A data analyst wants to assign a unique sequential integer to each row in a result set, starting at 1, based on the order of the 'sales_amount' column descending. Which window function should be used?

A.DENSE_RANK() OVER (ORDER BY sales_amount DESC)
B.RANK() OVER (ORDER BY sales_amount DESC)
C.NTILE(1) OVER (ORDER BY sales_amount DESC)
D.ROW_NUMBER() OVER (ORDER BY sales_amount DESC)
AnswerD

Correct: assigns sequential numbers based on the order.

Why this answer

ROW_NUMBER() assigns a unique sequential integer to each row within a partition, starting at 1.

170
Multi-Selecteasy

A data analyst needs to retrieve the top 5 most expensive products from a 'products' table sorted by price descending. Which TWO SQL clauses are required to achieve this? (Select TWO).

Select 2 answers
A.HAVING COUNT(*) > 1
B.WHERE price > 100
C.ORDER BY price DESC
D.GROUP BY price
E.LIMIT 5
AnswersC, E

Sorts prices from highest to lowest.

Why this answer

ORDER BY DESC sorts prices descending, and LIMIT restricts to 5 rows. GROUP BY and HAVING are for aggregation; WHERE is for filtering but not needed here.

171
MCQhard

You have a table 'Orders' with columns order_id, customer_id, order_date, and amount. You need to write a query that returns each customer's most recent order date and the amount for that order. Which approach is correct?

A.SELECT customer_id, MAX(order_date), amount FROM Orders GROUP BY customer_id
B.SELECT customer_id, order_date, amount FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn FROM Orders) t WHERE rn = 1
C.SELECT customer_id, FIRST_VALUE(order_date) OVER (PARTITION BY customer_id ORDER BY order_date DESC), FIRST_VALUE(amount) OVER (PARTITION BY customer_id ORDER BY order_date DESC) FROM Orders
D.SELECT customer_id, order_date, amount FROM Orders WHERE order_date IN (SELECT MAX(order_date) FROM Orders GROUP BY customer_id)
AnswerB

Correctly identifies the most recent order per customer.

Why this answer

Using a window function with ROW_NUMBER() to rank orders per customer by date descending, then filtering for rank=1, gives the most recent order details. FIRST_VALUE() can also get the amount, but requires careful framing. GROUP BY with MAX(date) alone cannot get the corresponding amount.

172
MCQeasy

A retail company wants to analyze customer purchase patterns to identify products frequently bought together. Which data mining technique is most appropriate?

A.Classification
B.Clustering
C.Regression
D.Association rules
AnswerD

Association rules identify frequent itemsets and co-occurrence patterns.

Why this answer

Association rules (market basket analysis) discover co-occurrence relationships. Regression predicts numeric values, clustering groups similar items, classification assigns categories.

173
MCQeasy

A data analyst needs to retrieve only unique job titles from the 'employees' table. Which SQL keyword should be used in the SELECT clause?

A.TOP
B.DISTINCT
C.UNIQUE
D.FILTER
AnswerB

DISTINCT returns unique rows.

Why this answer

The DISTINCT keyword removes duplicate rows from the result set, returning only unique values.

174
Multi-Selecteasy

Which TWO of the following are valid SQL clauses used to filter and sort data?

Select 2 answers
A.DELETE
B.WHERE
C.ORDER BY
D.UPDATE
E.INSERT
AnswersB, C

WHERE filters rows based on conditions.

Why this answer

The WHERE clause is used to filter rows based on specified conditions, while the ORDER BY clause sorts the result set in ascending or descending order. Both are standard SQL clauses for data filtering and sorting, respectively.

Exam trap

CompTIA often tests the distinction between SQL DML statements (DELETE, UPDATE, INSERT) and query clauses (WHERE, ORDER BY), trapping candidates who confuse data manipulation commands with data retrieval or sorting operations.

175
Multi-Selecthard

A data analyst is using Python pandas to perform exploratory data analysis. Which THREE methods are commonly used to assess data quality and distributions?

Select 3 answers
A.df.transpose()
B.df.describe()
C.df.info()
D.df.sort_values()
E.df.value_counts()
AnswersB, C, E

Provides summary statistics for numerical columns.

Why this answer

describe() gives summary statistics, info() shows data types and non-null counts, and value_counts() shows frequency distributions.

176
Multi-Selecteasy

A data analyst wants to export a summary report from a DataFrame in pandas. Which THREE methods are commonly used for data export?

Select 3 answers
A.to_csv()
B.to_pickle()
C.to_excel()
D.to_sql()
E.to_json()
AnswersA, C, E

Exports to CSV file.

Why this answer

pandas provides to_csv, to_excel, and to_json for exporting data.

177
Drag & Dropmedium

Drag and drop the steps to perform a data backup using the 3-2-1 rule in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

The 3-2-1 rule involves multiple copies, different media, offsite storage, and regular testing.

178
MCQhard

A data engineer is tasked with acquiring data from a third-party vendor that provides daily file drops via SFTP. The files are large (10 GB each). The pipeline must load data into a data warehouse. Which approach optimizes for speed and reliability?

A.Download the file to a staging server, then bulk insert into warehouse
B.Stream the file directly from SFTP into warehouse using a data pipeline tool
C.Have the vendor push data via API instead of SFTP
D.Split the file into smaller chunks and load concurrently
AnswerB

Streaming minimizes latency and storage overhead.

Why this answer

Streaming the file directly from SFTP into the warehouse using a data pipeline tool (e.g., Apache NiFi, Airbyte, or Fivetran) eliminates the intermediate staging step, reducing disk I/O and latency. This approach leverages incremental processing and parallel streams to handle large 10 GB files efficiently, while built-in retry and checkpoint mechanisms ensure reliability against network interruptions.

Exam trap

The trap here is that candidates assume 'download then load' (Option A) is the most reliable approach, but the question specifically asks for speed and reliability, and streaming avoids the I/O bottleneck and single-point-of-failure of a staging server.

How to eliminate wrong answers

Option A is wrong because downloading the file to a staging server introduces an unnecessary intermediate write and read cycle, doubling I/O time and adding a single point of failure; bulk insert after full download also delays loading until the entire file is present, which is suboptimal for speed. Option C is wrong because having the vendor push data via API instead of SFTP does not inherently optimize speed or reliability for large daily file drops—APIs often have payload size limits (e.g., 10 MB) and require chunking, adding complexity and potential throttling, while SFTP is already a reliable file transfer protocol. Option D is wrong because splitting the file into smaller chunks and loading concurrently can cause resource contention (e.g., connection pool exhaustion, lock contention) and requires careful coordination to maintain data consistency; it does not address the fundamental bottleneck of downloading the entire file before processing.

179
Multi-Selectmedium

A data analyst wants to retrieve the top 5 highest-paid employees from the 'employees' table. Which SQL clauses could be used to achieve this? (Select TWO.)

Select 2 answers
A.ORDER BY salary DESC
B.HAVING salary
C.ORDER BY salary ASC
D.LIMIT 5
E.GROUP BY salary
AnswersA, D

Sorts highest to lowest.

Why this answer

ORDER BY salary DESC sorts descending, and LIMIT/TOP/FETCH restricts rows.

180
MCQmedium

A data analyst is profiling a new dataset containing customer information. When assessing data quality, which metric would be most appropriate to determine if the 'email' column contains valid email addresses?

A.Pattern analysis
B.Null count
C.Cardinality
D.Row count
AnswerA

Pattern analysis can verify if values match the typical email format.

Why this answer

Pattern analysis (e.g., using regular expressions) can validate whether strings match the expected format of an email address. Row counts, null counts, and cardinality do not validate format.

181
MCQhard

A data analyst is using the IQR method to identify outliers in a dataset. The first quartile (Q1) is 25 and the third quartile (Q3) is 45. What is the upper bound for identifying outliers?

A.85
B.65
C.75
D.55
AnswerC

Correct: Q3 + 1.5*(Q3-Q1).

Why this answer

Upper bound = Q3 + 1.5 * IQR; IQR = Q3 - Q1 = 20; 1.5*20 = 30; 45+30 = 75.

182
MCQhard

A data analyst sees this error in the ETL logs. What is the most likely cause?

A.The underlying data source was modified after the last refresh
B.The source table was dropped
C.The analyst does not have permission to refresh the view
D.There is a network connection timeout
AnswerA

The log is newer, indicating changes that need a full refresh.

Why this answer

The error indicates that the materialized view's underlying data has changed since its last refresh. Materialized views rely on change tracking (e.g., logs or timestamps) to perform incremental refreshes. If the source data was modified after the last refresh, the view cannot be incrementally refreshed—a full refresh is required instead.

This mismatch between the view's snapshot and the source data is a common cause of refresh failures in ETL processes.

Exam trap

CompTIA Data+ often tests the distinction between incremental (fast) and full refreshes. Candidates may confuse a source modification with a dropped table or permission issue, but the error message specifically points to a change in the underlying data after the last refresh, not to structural or permission problems.

How to eliminate wrong answers

Option B is wrong because dropping the source table would cause a different error (e.g., 'table or view does not exist') rather than a log-related error. Option C is wrong because a permission issue would typically result in an 'insufficient privileges' error, not a log mismatch. Option D is wrong because a network timeout would produce a connection error (e.g., ORA-12170 or ORA-03113), not a materialized view log inconsistency.

183
MCQmedium

A data analyst uses the following query: SELECT department, AVG(salary) AS avg_salary FROM employees GROUP BY department HAVING AVG(salary) > 50000. What is the purpose of the HAVING clause in this query?

A.To ensure only departments with more than 50000 employees are shown
B.To filter individual employee records before grouping
C.To sort departments by average salary
D.To filter groups (departments) based on the average salary
AnswerD

HAVING filters groups after GROUP BY.

Why this answer

HAVING filters groups after aggregation, similar to WHERE but for aggregated results.

184
Multi-Selecthard

After merging two datasets, an analyst finds that the resulting dataset has many null values in some columns. Which TWO steps should the analyst take to address this? (Select two.)

Select 2 answers
A.Ignore nulls and proceed.
B.Impute nulls with the median.
C.Remove all rows with nulls.
D.Replace nulls with a placeholder value like 'Unknown'.
E.Investigate the cause of nulls.
AnswersB, E

Median imputation preserves dataset size and reduces bias.

Why this answer

Imputing nulls with the median is a standard technique for handling missing numerical data, especially when the distribution is skewed or contains outliers. The median is robust to extreme values and preserves the central tendency of the column, making it a safe choice for many analytical models. This approach avoids data loss while maintaining statistical integrity.

Exam trap

The trap here is that candidates may think 'Ignore nulls and proceed' is acceptable, but the exam tests the understanding that nulls must be actively handled to ensure data quality and model validity, not simply overlooked.

185
MCQeasy

A data analyst runs the following query: SELECT DISTINCT city FROM customers. What is the primary purpose of using the DISTINCT keyword in this query?

A.To sort the cities alphabetically
B.To count the number of cities
C.To filter cities that start with a specific letter
D.To remove duplicate city names
AnswerD

DISTINCT eliminates duplicate rows, returning unique city values.

Why this answer

DISTINCT removes duplicate rows from the result set. In this query, it returns each unique city name only once.

186
MCQeasy

A data analyst is tasked with collecting data from multiple spreadsheets provided by different departments. Each spreadsheet has different column names and formats. What is the best first step?

A.Develop a data dictionary and standardize column names
B.Discard any mismatched data
C.Use a machine learning model to clean data
D.Immediately load all data into a database
AnswerA

Standardization ensures all data sources align, making subsequent loading and analysis consistent.

Why this answer

Developing a data dictionary and standardizing column names ensures consistency across all data sources before loading, reducing errors and facilitating integration. Immediately loading data can cause inconsistencies. Discarding mismatched data loses potentially valuable information.

Using a machine learning model is an unnecessary and complex first step.

187
MCQmedium

A data analyst uses a CTE to find employees who earn more than the average salary in their department. Which SQL clause is used to define the CTE?

A.DECLARE
B.WITH
C.DEFINE
D.CTE
AnswerB

Correct. WITH defines a CTE.

Why this answer

Common Table Expressions (CTEs) are defined using the WITH keyword, followed by the CTE name and AS (query).

188
MCQhard

A data analyst needs to calculate the running total of sales for each product over time. Which window function clause is essential for this calculation?

A.ORDER BY sale_date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW
B.PARTITION BY product_id ORDER BY sale_date
C.PARTITION BY product_id
D.ORDER BY sale_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
AnswerB

Correct. Contains both PARTITION BY product_id (for per-product totals) and ORDER BY sale_date (for ordering over time), which together enable a running total with the default frame.

Why this answer

For a running total of sales for each product over time, you must group the calculation by product (PARTITION BY product_id) and order by sale_date (ORDER BY sale_date). The default window frame in SQL (RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) suffices for running totals. Option B provides both PARTITION BY product_id and ORDER BY sale_date, making it essential.

189
MCQmedium

An e-commerce company is acquiring product data from multiple supplier APIs. The APIs return JSON with inconsistent field naming conventions. Which data acquisition technique should be applied?

A.Data compression
B.Data mapping and transformation
C.Data deduplication
D.Data aggregation
AnswerB

Standardizes field names and structures.

Why this answer

Data mapping and transformation is the correct technique because the JSON responses from different supplier APIs use inconsistent field naming conventions (e.g., 'product_id' vs. 'ProductID'). This technique defines a schema to map source fields to a standardized target format, ensuring data consistency before loading into the company's system. Without transformation, downstream processes like analytics or inventory management would fail due to mismatched field names.

Exam trap

The trap here is that candidates confuse data transformation with data aggregation or deduplication, assuming any processing step can fix schema inconsistencies, but only mapping and transformation directly address field naming and structure mismatches.

How to eliminate wrong answers

Option A is wrong because data compression reduces storage size or transfer bandwidth, but does not address structural inconsistencies in field naming. Option C is wrong because data deduplication removes duplicate records based on content, but does not reconcile different field names or schemas. Option D is wrong because data aggregation summarizes or combines data (e.g., sums, averages), but does not resolve naming conflicts or schema mismatches.

190
MCQhard

A dataset contains transaction amounts with a few extremely high values. The analyst wants to reduce the impact of these outliers on the average. Which measure of central tendency is most robust?

A.Mean
B.Median
C.Mode
D.Standard deviation
AnswerB

Median is robust to outliers.

Why this answer

Median is not affected by extreme values, while mean is sensitive.

191
MCQmedium

During exploratory data analysis, you calculate the IQR for a numeric column and find that several data points fall below Q1 - 1.5*IQR. These points are likely:

A.Normal variations within the distribution
B.The mode of the dataset
C.The median of the dataset
D.Outliers
AnswerD

The IQR method identifies outliers.

Why this answer

The IQR method defines outliers as points below Q1 - 1.5*IQR or above Q3 + 1.5*IQR. Points below the lower fence are considered outliers. They are not necessarily errors, but potential outliers.

They are not the median or mode.

192
Multi-Selectmedium

Which TWO are valid data acquisition methods? (Select two.)

Select 2 answers
A.Web scraping
B.Data normalization
C.API calls
D.Data encryption
E.Data profiling
AnswersA, C

Web scraping extracts data from websites and is a common acquisition method.

Why this answer

Web scraping and API calls are direct methods to acquire data from external sources. Data profiling and data normalization are data preparation techniques, not acquisition. Data encryption is a security measure.

193
MCQeasy

You are using pandas in Python to clean a dataset. You notice several rows with missing values in the 'age' column. Which method would you use to remove those rows?

A.df.drop_duplicates()
B.df.dropna()
C.df.fillna(0)
D.df.isna()
AnswerB

Removes rows with any missing values by default.

Why this answer

df.dropna() removes rows with any missing values by default. df.fillna() fills missing values, df.isna() returns a boolean mask, df.drop_duplicates() removes duplicate rows.

194
MCQhard

An analyst needs to compute a running total of sales for each department, ordered by date. Which window function is most appropriate?

A.ROW_NUMBER() OVER (PARTITION BY department ORDER BY date)
B.SUM(sales) OVER (ORDER BY date)
C.SUM(sales) OVER (PARTITION BY department ORDER BY date)
D.LAG(sales, 1) OVER (PARTITION BY department ORDER BY date)
AnswerC

Partitions by department and orders by date to compute running total per department.

Why this answer

SUM() with OVER(PARTITION BY department ORDER BY date) computes a running total within each department.

195
MCQmedium

A data analyst is performing data profiling on a customer table. Which metric provides the number of unique values in a column?

A.Row count
B.Cardinality
C.Standard deviation
D.Null count
AnswerB

Cardinality is the number of distinct values.

Why this answer

Cardinality refers to the number of distinct values in a column.

196
Multi-Selecteasy

A data analyst is performing data acquisition from multiple source files. Which TWO data profiling tasks should the analyst complete before loading the data into the target system?

Select 2 answers
A.Create a dashboard for stakeholders
B.Verify data types and formats
C.Build a linear regression model
D.Perform cluster analysis
E.Identify missing values and nulls
AnswersB, E

Verifying data types ensures consistency and prevents errors during loading.

Why this answer

Identifying missing values and verifying data types are fundamental data profiling tasks that help ensure data quality before acquisition. Building models, creating dashboards, or clustering are not part of profiling.

197
MCQeasy

A small business wants to acquire customer feedback through a short questionnaire emailed after purchase. Which data acquisition method does this represent?

A.Transaction log
B.Interview
C.Survey
D.Observation
AnswerC

A questionnaire is a classic survey tool for collecting feedback.

Why this answer

A survey is a structured data collection method where respondents answer predefined questions, typically via a form or questionnaire. In this scenario, the business is using a short questionnaire emailed after purchase to gather customer feedback, which directly aligns with the definition of a survey as a data acquisition method.

Exam trap

The trap here is that candidates may confuse a survey with a transaction log because both can be automated and delivered electronically, but a transaction log captures system events, not user-provided feedback.

How to eliminate wrong answers

Option A is wrong because a transaction log records system-level events such as database changes, user logins, or API calls, not subjective customer feedback via a questionnaire. Option B is wrong because an interview involves a direct, synchronous conversation between an interviewer and a respondent, often with open-ended questions, whereas the scenario describes an asynchronous, self-administered questionnaire. Option D is wrong because observation involves watching and recording behavior or events without direct interaction, whereas the scenario explicitly involves asking customers for their opinions through a questionnaire.

198
MCQhard

A data analyst is using a public API to collect historical weather data. The API has a rate limit of 100 requests per minute, but the analyst needs to retrieve 10,000 records as quickly as possible. What strategy should be used?

A.Increase the request rate
B.Use multiple API keys
C.Paginate with appropriate delays
D.Download a precompiled dataset
AnswerC

Pagination allows systematic retrieval; delays ensure compliance with rate limits.

Why this answer

Paginating with appropriate delays respects the API's rate limit of 100 requests per minute while maximizing throughput. By splitting the 10,000 records into pages (e.g., 100 records per page) and sending requests at a rate just under the limit (e.g., one request every 0.6 seconds), the analyst can retrieve all data in approximately 100 minutes without triggering HTTP 429 rate-limit errors.

Exam trap

The trap here is that candidates may assume 'as quickly as possible' means sending requests as fast as possible (Option A) or using multiple keys (Option B), overlooking that rate limits are enforced per key or IP and that proper pagination with delays is the only compliant way to maximize throughput.

How to eliminate wrong answers

Option A is wrong because increasing the request rate beyond 100 requests per minute would violate the API's rate limit, resulting in HTTP 429 (Too Many Requests) responses or temporary IP bans. Option B is wrong because using multiple API keys to circumvent rate limits violates the API's terms of service and could lead to account suspension or revocation of access. Option D is wrong because downloading a precompiled dataset may not be available, may not contain the specific historical weather data needed, or may be outdated, and the question explicitly states the analyst is using a public API to collect data.

199
MCQmedium

Refer to the exhibit. A data analyst is trying to extract data from a SQL Server database but receives the error. Which configuration change should the analyst recommend to the database administrator?

A.Change the server firewall to allow port 1433
B.Enable Mixed Mode authentication on the SQL Server
C.Use a different extraction tool that supports Windows authentication
D.Grant the 'dataminer' user SELECT permissions
AnswerB

Mixed Mode allows SQL authentication, which matches the login attempt.

Why this answer

The error indicates that the server is configured for Windows authentication only, but the login attempt used SQL authentication. Enabling Mixed Mode authentication allows both Windows and SQL authentication, resolving the issue.

200
MCQhard

A data analyst is using a window function to assign a unique rank to each employee within their department based on salary, with ties receiving the same rank and leaving gaps. Which function should be used?

A.DENSE_RANK()
B.RANK()
C.ROW_NUMBER()
D.NTILE()
AnswerB

RANK() assigns same rank to ties and leaves gaps.

Why this answer

RANK() assigns the same rank to ties and leaves gaps (e.g., 1,1,3). DENSE_RANK() does not leave gaps.

201
MCQmedium

A company is merging two customer databases from different acquisitions. They need to identify duplicate records. Which data profiling technique is most effective?

A.Fuzzy matching on name and address
B.Manually compare all records
C.Exact match on customer names
D.Use primary keys from each database
AnswerA

Fuzzy matching handles variations and is appropriate for deduplication.

Why this answer

Fuzzy matching on name and address is the most effective technique because customer databases from different acquisitions often contain variations in spelling, formatting, and abbreviations (e.g., 'Bob' vs. 'Robert', 'St.' vs. 'Street'). Exact matching would miss these duplicates, while fuzzy matching uses algorithms like Levenshtein distance or Jaro-Winkler to quantify similarity and identify near-matches, ensuring comprehensive deduplication.

Exam trap

The trap here is that candidates assume exact matching or primary keys are sufficient for deduplication, overlooking the real-world data inconsistencies that fuzzy matching is designed to handle.

How to eliminate wrong answers

Option B is wrong because manually comparing all records is impractical and error-prone for large datasets, lacking scalability and consistency. Option C is wrong because exact match on customer names fails to capture duplicates caused by typos, nicknames, or inconsistent formatting (e.g., 'Jon' vs. 'John'). Option D is wrong because primary keys from each database are unique within their own system but cannot identify cross-database duplicates, as the same customer may have different primary keys in each source.

202
MCQmedium

A data engineer is designing an ETL pipeline to extract sales data from a legacy on-premise database and load it into a cloud data warehouse. The database is slow and queries during business hours affect performance. Which extraction strategy minimizes impact?

A.Query the database with SELECT * every hour
B.Incremental extraction using Change Data Capture (CDC)
C.Full table extraction nightly
D.Use a database log shipping
AnswerB

CDC minimizes database load by extracting only changed data, reducing performance impact.

Why this answer

Incremental extraction using Change Data Capture (CDC) minimizes impact on the legacy on-premise database by reading only the changed rows (inserts, updates, deletes) from transaction logs or change tables, rather than issuing heavy SELECT queries. This avoids full table scans or frequent queries during business hours, preserving database performance for operational workloads.

Exam trap

The trap here is that candidates confuse 'log shipping' (a high-availability technique) with 'Change Data Capture' (an extraction method), or assume that any periodic query (like hourly SELECT *) is acceptable without considering the cumulative performance impact on a slow legacy database.

How to eliminate wrong answers

Option A is wrong because querying the database with SELECT * every hour performs full table scans on the legacy database, which is slow and would degrade performance during business hours, directly contradicting the goal of minimizing impact. Option C is wrong because full table extraction nightly still requires a complete scan of the entire table, which can be resource-intensive and may not complete within a reasonable window if the database is slow, and it does not capture intra-day changes without additional overhead. Option D is wrong because database log shipping is a disaster recovery technique that continuously copies transaction logs to a standby server, not an extraction strategy for ETL; it does not provide a queryable change stream and would require additional processing to parse logs for CDC.

203
MCQmedium

A data analyst is performing exploratory data analysis on a dataset containing house prices. They want to identify outliers in the 'price' column using the IQR method. The first quartile (Q1) is $200,000, the third quartile (Q3) is $350,000, and the IQR is $150,000. What is the upper bound for identifying outliers?

A.$500,000
B.$575,000
C.$425,000
D.$650,000
AnswerB

Correct upper bound.

Why this answer

The IQR method defines outliers as values below Q1 - 1.5*IQR or above Q3 + 1.5*IQR. Upper bound = 350,000 + (1.5 * 150,000) = 350,000 + 225,000 = $575,000.

204
MCQmedium

A data analyst is using SQL to filter a sales table for transactions that occurred in either 'Q1' or 'Q3' of 2023 and have a sale amount greater than $100. Which WHERE clause correctly implements this condition?

A.WHERE quarter IN ('Q1','Q3') OR amount > 100
B.WHERE quarter = 'Q1' OR quarter = 'Q3' AND amount > 100
C.WHERE quarter = 'Q1' AND amount > 100 OR quarter = 'Q3' AND amount > 100
D.WHERE (quarter = 'Q1' OR quarter = 'Q3') AND amount > 100
AnswerC, D

This is logically equivalent but redundant and not the standard concise form.

Why this answer

Both C and D correctly implement the filter. SQL's operator precedence gives AND higher priority than OR, so option C is parsed as (quarter = 'Q1' AND amount > 100) OR (quarter = 'Q3' AND amount > 100), which is equivalent to (quarter = 'Q1' OR quarter = 'Q3') AND amount > 100. Option D expresses the same condition directly with parentheses.

205
MCQhard

Based on the exhibit, what is the most likely cause of the import failure?

A.The file is empty or contains only headers.
B.The price field includes non-numeric characters that cannot be parsed.
C.The source file is corrupted or in an unsupported format.
D.A data quality issue: the date field contains an invalid date.
AnswerD

The date '2024-02-30' is invalid and caused the import to halt.

Why this answer

The exhibit shows a date field containing '2023-02-30', which is an invalid date (February never has 30 days). This data quality issue causes the import to fail, as the system likely validates date values against calendar rules before inserting them into the target table. The error is not due to file emptiness, non-numeric characters, or corruption, but specifically a semantic data integrity violation.

Exam trap

The trap here is that candidates may overlook semantic data quality issues (like invalid dates) and instead focus on syntactic problems (like file format or non-numeric characters), even though the exhibit clearly shows a date that does not exist in the calendar.

How to eliminate wrong answers

Option A is wrong because the file contains multiple rows of data beyond headers, as evidenced by the visible records in the exhibit. Option B is wrong because the price field shows numeric values (e.g., 19.99, 29.99) without any non-numeric characters that would cause parsing failures. Option C is wrong because the source file is displayed in a standard CSV format with proper delimiters and readable content, indicating it is not corrupted or in an unsupported format.

206
Multi-Selecteasy

A data analyst is using pandas to clean a DataFrame that contains missing values in the 'age' and 'income' columns. Which THREE pandas methods are appropriate for handling missing data? (Select THREE).

Select 3 answers
A.dropna()
B.pivot_table()
C.merge()
D.apply() with a custom function
E.fillna()
AnswersA, D, E

Removes rows with missing values.

Why this answer

Common pandas methods for missing data include dropna (remove rows with NaN), fillna (replace NaN with a value), and apply with a custom function. Merge is for combining DataFrames; pivot_table is for reshaping.

207
Multi-Selecthard

An e-commerce company wants to analyze sales performance across product categories. The dataset includes transaction amounts and a column 'category' with values (Electronics, Clothing, Home). The analyst decides to use stratified sampling to ensure proportional representation. Which THREE steps are required to implement this? (Select THREE).

Select 3 answers
A.Calculate the proportion of each category in the population
B.Take a random sample from each stratum with size proportional to its population proportion
C.Divide the dataset into three strata based on category
D.Select every 10th transaction from the entire dataset
E.Combine all categories into a single group and perform simple random sampling
AnswersA, B, C

Proportions are needed to determine sample sizes per stratum.

Why this answer

Stratified sampling requires dividing the population into strata (categories), then randomly sampling from each stratum in proportion to its size. Combining strata or simple random sampling without stratification would not achieve proportional representation.

208
MCQmedium

A data analyst wants to find customers whose last name starts with 'Mc' and have made purchases in 2023. The purchase table has a purchase_date column. Which SQL query accomplishes this?

A.SELECT * FROM customers WHERE last_name LIKE 'Mc_' AND YEAR(purchase_date) = 2023;
B.SELECT * FROM customers WHERE last_name LIKE '%Mc%' AND purchase_date = 2023;
C.SELECT * FROM customers WHERE last_name = 'Mc%' AND YEAR(purchase_date) = 2023;
D.SELECT * FROM customers c JOIN purchases p ON c.id = p.customer_id WHERE last_name LIKE 'Mc%' AND p.purchase_date BETWEEN '2023-01-01' AND '2023-12-31';
AnswerD

Correct use of LIKE, JOIN, and date range.

Why this answer

The correct query (option D) joins the customers and purchases tables on customer ID to link customers with their purchases. It uses `LIKE 'Mc%'` to match last names starting with 'Mc' (the wildcard '%' matches any sequence of characters) and filters purchase dates within the year 2023 using `BETWEEN '2023-01-01' AND '2023-12-31'`. Options A, B, and C are incorrect: A uses `LIKE 'Mc_'` which matches exactly two characters after 'Mc', not any sequence; B uses `LIKE '%Mc%'` which matches 'Mc' anywhere in the name, not just the beginning; C uses `= 'Mc%'` which treats the wildcard as a literal character; and all three fail to join the purchases table, so they cannot filter by purchase date.

← PreviousPage 3 of 3 · 208 questions total

Ready to test yourself?

Try a timed practice session using only Data Acquisition and Preparation questions.