50 multiple-choice questions with answers and detailed explanations. Untimed — choose an answer to check it instantly.
0/50 answered0 correct
Question 1 of 50
A data analyst needs to retrieve unique values from a column in a database. Which SQL function should the analyst use?
Correct answer: B) COUNT DISTINCT
Explanation: The COUNT DISTINCT function is used in SQL to return only unique values from the specified column. The regular COUNT function would return the total number of values, including duplicates.
Question 2 of 50
Which SQL command allows a data analyst to create a table in a database?
Correct answer: C) CREATE
Explanation: The CREATE command in SQL is used to create a new table in the database. ALTER is used to modify existing tables, while INSERT and UPDATE are used to add and modify data in the table.
Question 3 of 50
What is the purpose of the VLOOKUP function in spreadsheets?
Correct answer: B) To search for a value vertically
Explanation: The VLOOKUP function is used to search for a value in the first column of a vertical table or range and return a value in the same row from a specified column.
Question 4 of 50
An analyst needs to filter data in a spreadsheet based on multiple conditions. Which function should they use?
Correct answer: C) COUNTIFS
Explanation: The COUNTIFS function allows an analyst to count the number of cells that meet multiple conditions. SUMIFS would sum values based on conditions, while COUNTIF and SUMIF only apply one condition.
Question 5 of 50
A data professional needs to connect two tables in a SQL query based on matching values in both tables. Which SQL function should they use?
Correct answer: C) INNER JOIN
Explanation: The INNER JOIN function returns only the rows where there is a match in both tables. LEFT JOIN and RIGHT JOIN include all rows from one table, and FULL OUTER JOIN returns all rows from both tables.
Question 6 of 50
Which R function can be used to remove special characters from column names?
Correct answer: A) clean_names()
Explanation: The clean_names() function from the janitor package is used to clean column names by removing special characters and spaces.
Question 7 of 50
Which SQL clause is used to group rows that have the same values in a table?
Correct answer: B) GROUP BY
Explanation: The GROUP BY clause groups rows that have the same values into summary rows. It is often used with aggregate functions like SUM, COUNT, and AVG.
Question 8 of 50
Which Excel function calculates the sum of values based on a specified condition?
Correct answer: A) SUMIF
Explanation: SUMIF adds up all the numbers in a range that meet a single condition specified by the user.
Question 9 of 50
In R, which package is used for creating complex data visualizations?
Correct answer: B) ggplot2
Explanation: The ggplot2 package is primarily used for creating advanced data visualizations in R, including scatterplots, line charts, and bar charts.
Question 10 of 50
A data analyst wants to join two tables and return all rows from the left table and matching rows from the right table. Which SQL function should they use?
Correct answer: B) LEFT JOIN
Explanation: LEFT JOIN returns all rows from the left table and the matching rows from the right table. If no match exists, NULL values are returned for columns from the right table.
Question 11 of 50
An analyst wants to ensure that certain conditions are met for multiple fields in a dataset. Which type of validation are they performing?
Correct answer: B) Cross-field validation
Explanation: Cross-field validation ensures that multiple fields in a dataset meet specific conditions or dependencies.
Question 12 of 50
Which SQL clause filters the results of a query based on a specified condition?
Correct answer: C) WHERE
Explanation: The WHERE clause in SQL is used to filter records that meet a specified condition.
Question 13 of 50
In Excel, which function returns the smallest value from a range of numbers?
Correct answer: A) MIN
Explanation: The MIN function returns the smallest value from a specified range of numbers.
Question 14 of 50
A data analyst is performing calculations on a dataset in SQL. How can they ensure that the order of operations is correct?
Correct answer: B) Using parentheses ()
Explanation: Parentheses are used in SQL to control the order of operations in mathematical expressions, ensuring the calculations are performed in the correct sequence.
Question 15 of 50
Which SQL command is used to change the structure of an existing table by adding a new column?
Correct answer: C) ALTER
Explanation: The ALTER command in SQL allows a user to modify an existing table by adding, deleting, or modifying columns.
Question 16 of 50
Which R function returns the type of a variable or data structure?
Correct answer: D) typeof()
Explanation: The typeof() function in R is used to determine the type of a variable or data structure.
Question 17 of 50
In SQL, which operator is used to filter records that match a specific pattern?
Correct answer: B) LIKE
Explanation: The LIKE operator in SQL is used to search for records that match a specified pattern. It is often used with wildcard characters like '%' and '_'.
Question 18 of 50
Which R function can be used to calculate the average of values in a vector?
Correct answer: A) mean()
Explanation: The mean() function calculates the average of all values in a vector or dataset.
Question 19 of 50
A data analyst needs to return the sum of the products of corresponding values in two arrays in Excel. Which function should they use?
Correct answer: B) SUMPRODUCT
Explanation: SUMPRODUCT multiplies corresponding values in arrays and returns the sum of those products.
Question 20 of 50
In R, which function is used to create a scatterplot?
Correct answer: B) geom_point()
Explanation: The geom_point() function in the ggplot2 package is used to create scatterplots by plotting points based on the specified x and y coordinates.
Question 21 of 50
Which SQL clause is used to sort the result set of a query?
Correct answer: A) ORDER BY
Explanation: The ORDER BY clause sorts the rows returned by a query, ascending by default or descending with the DESC keyword.
Question 22 of 50
Which SQL clause filters groups after aggregation has been applied?
Correct answer: B) HAVING
Explanation: HAVING filters grouped results after aggregation, whereas WHERE filters individual rows before grouping occurs.
Question 23 of 50
Which SQL command adds new rows of data to a table?
Correct answer: C) INSERT INTO
Explanation: INSERT INTO adds one or more new rows of data to an existing table, specifying columns and their values.
Question 24 of 50
Which SQL command modifies existing rows in a table?
Correct answer: D) UPDATE
Explanation: UPDATE changes values in existing rows, typically combined with a WHERE clause to target specific rows. ALTER changes table structure, not data.
Question 25 of 50
Which SQL command removes rows from a table?
Correct answer: A) DELETE
Explanation: DELETE removes rows from a table, filtered by a WHERE clause. DROP removes an entire table or object, not individual rows.
Question 26 of 50
Which SQL aggregate function returns the number of rows?
Correct answer: B) COUNT
Explanation: COUNT returns the number of rows matching the query. COUNT(*) counts all rows, while COUNT(column) counts non-null values in that column.
Question 27 of 50
Which SQL aggregate function calculates the average of a numeric column?
Correct answer: C) AVG
Explanation: AVG computes the arithmetic mean of the values in a numeric column, ignoring null values.
Question 28 of 50
Which SQL aggregate function returns the largest value in a column?
Correct answer: D) MAX
Explanation: MAX returns the maximum value found in the specified column. MIN returns the smallest.
Question 29 of 50
What does an INNER JOIN return?
Correct answer: A) Only rows with matching values in both tables
Explanation: An INNER JOIN returns only the rows where the join condition is satisfied in both tables, excluding unmatched rows.
Question 30 of 50
What does a RIGHT JOIN return?
Correct answer: B) All rows from the right table plus matching rows from the left
Explanation: A RIGHT JOIN returns every row from the right table, with matching data from the left where available and NULL where there is no match.
Question 31 of 50
Which SQL operator combines the result sets of two queries into one, removing duplicates?
Correct answer: C) UNION
Explanation: UNION combines the results of two SELECT statements and removes duplicate rows. UNION ALL keeps duplicates.
Question 32 of 50
Which SQL operator tests whether a value is within a list of values?
Correct answer: D) IN
Explanation: The IN operator checks whether a value matches any value in a specified list, a concise alternative to multiple OR conditions.
Question 33 of 50
Which SQL operator selects values within an inclusive range?
Correct answer: A) BETWEEN
Explanation: BETWEEN selects values within an inclusive range, for example WHERE age BETWEEN 18 AND 65.
Question 34 of 50
How does SQL handle NULL values in most comparisons?
Correct answer: B) Comparisons with NULL return unknown, so IS NULL must be used
Explanation: NULL represents missing data, and comparisons with NULL yield unknown rather than true or false, so IS NULL or IS NOT NULL must be used to test for it.
Question 35 of 50
What is a primary key in a relational database?
Correct answer: C) A column or set of columns that uniquely identifies each row
Explanation: A primary key uniquely identifies each row in a table, cannot contain NULL, and there is only one per table.
Question 36 of 50
What is a foreign key?
Correct answer: D) A column that references the primary key of another table
Explanation: A foreign key references the primary key of another table, enforcing referential integrity between related records.
Question 37 of 50
What is the purpose of database normalization?
Correct answer: A) Organizing data to reduce redundancy and improve integrity
Explanation: Normalization structures tables to minimize redundant data and dependency problems, reducing anomalies during insert, update, and delete operations.
Question 38 of 50
What is a database index primarily used for?
Correct answer: B) Speeding up data retrieval at the cost of extra storage
Explanation: An index is a data structure that lets the database locate rows quickly without scanning the whole table, improving read speed while adding storage and write overhead.
Question 39 of 50
What is a subquery in SQL?
Correct answer: C) A query nested inside another query
Explanation: A subquery is a query embedded within another query, often used in a WHERE or FROM clause to provide intermediate results.
Question 40 of 50
Which Excel function counts cells that meet a single condition?
Correct answer: D) COUNTIF
Explanation: COUNTIF counts the number of cells in a range that satisfy a specified condition, such as counting values greater than 100.
Question 41 of 50
Which Excel function averages values that meet a condition?
Correct answer: A) AVERAGEIF
Explanation: AVERAGEIF computes the mean of cells in a range that meet a given criterion.
Question 42 of 50
Which Excel combination is a flexible alternative to VLOOKUP that can look left or right?
Correct answer: B) INDEX and MATCH
Explanation: INDEX combined with MATCH performs flexible lookups in any direction and is more robust than VLOOKUP, which can only look to the right of the lookup column.
Question 43 of 50
What does the Excel IF function do?
Correct answer: C) Returns one value if a condition is true and another if false
Explanation: IF evaluates a logical condition and returns one value when it is true and a different value when it is false, enabling conditional logic.
Question 44 of 50
What does a dollar sign in an Excel cell reference (for example $A$1) indicate?
Correct answer: D) An absolute reference that does not change when copied
Explanation: A dollar sign creates an absolute reference, locking the row and/or column so the reference does not shift when the formula is copied to other cells.
Question 45 of 50
What is an Excel PivotTable used for?
Correct answer: A) Summarizing and aggregating data interactively
Explanation: A PivotTable summarizes large datasets by grouping and aggregating values, letting users reorganize and explore data without formulas.
Question 46 of 50
Which R function reads a CSV file into a data frame?
Correct answer: B) read.csv()
Explanation: read.csv() imports a comma-separated values file into an R data frame, the most common structure for tabular data in R.
Question 47 of 50
Which R function provides a statistical summary of each column in a data frame?
Correct answer: C) summary()
Explanation: summary() returns descriptive statistics such as minimum, median, mean, and maximum for each column of a data frame.
Question 48 of 50
In R, what does the na.rm = TRUE argument do in functions like mean()?
Correct answer: D) Ignores missing (NA) values in the calculation
Explanation: Setting na.rm = TRUE tells the function to exclude NA (missing) values from the calculation, preventing the result from becoming NA.
Question 49 of 50
Which R package is widely used for data manipulation with functions like filter and mutate?
Correct answer: A) dplyr
Explanation: The dplyr package provides a grammar of data manipulation, including filter, select, mutate, arrange, and summarize for transforming data frames.
Question 50 of 50
What is a data frame in R?
Correct answer: B) A table-like structure with rows and columns of possibly different types
Explanation: A data frame is a two-dimensional table where each column can hold a different data type, the standard structure for datasets in R.
Set 1 complete
You scored 0%
0 correct out of 0 answered (50 questions in this set).