Courseiva

Databricks-Spark-Assoc · topic practice

Using Spark SQL practice questions

This domain covers querying and transforming data with Spark SQL on Databricks: SELECT statements, aggregations, joins, CTEs, and window functions, plus creating DataFrames from tables and tuning reads/writes. Questions test clause syntax and semantics, DataFrame creation paths, and configuration choices that control file sizes and driver memory during large result collection.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Using Spark SQL

What the exam tests

What to know about Using Spark SQL

Be able to write correct Spark SQL SELECT queries with WHERE, GROUP BY, and HAVING, create DataFrames from tables through the catalog, and tune Delta writes and driver memory. The key is knowing HAVING filters aggregates while WHERE filters rows before grouping.

Using GROUP BY with HAVING to filter on aggregated values rather than WHERE

Creating DataFrames from existing tables via spark.sql, spark.table, and spark.read.table

Reducing small-file output when writing to Delta Lake with partitioning and compaction settings

Adjusting Spark driver memory and result-size configs to avoid Driver OOM on collect

Watch out for

Common Using Spark SQL exam traps

  • ▸Using WHERE instead of HAVING to filter aggregated results, which fails because WHERE runs before aggregation
  • ▸Assuming spark.sql and spark.table behave identically for all catalog and temp-view resolution cases
  • ▸Collecting full result sets to the driver without limiting rows or raising driver memory, triggering OOM

Practice set

Using Spark SQL questions

20 questions · select your answer, then reveal the explanation

Question 1mediummultiple choice
Read the full Using Spark SQL explanation →

You have a Delta table named 'sales_data'. Which TWO SQL commands allow you to effectively manage data storage and query performance for this table?

Question 2mediummultiple choice
Read the full Using Spark SQL explanation →

Which THREE of the following are valid ways to create a Delta table in Spark SQL?

Question 3mediummultiple choice
Read the full Using Spark SQL explanation →

You are querying a large Delta table and notice that your query is scanning significantly more data than expected. Which technique allows you to restrict the data scanned by the query based on column values?

Question 4mediummultiple choice
Read the full Using Spark SQL explanation →

You need to update existing records in a Delta table based on a match from another DataFrame. Which TWO commands or techniques achieve this efficiently?

Question 5mediummultiple choice
Read the full Using Spark SQL explanation →

Which configuration setting is most important to tune when you observe that your Spark SQL job is failing due to 'Out of Memory' errors during a massive join operation?

Which SQL function is used to convert a string representation of a date into a DATE type in Spark SQL?

Question 7mediummultiple choice
Read the full Using Spark SQL explanation →

You are optimizing a Spark SQL query that performs an equi-join between a 10GB table and a 5MB lookup table. To maximize performance and avoid a shuffle, which action should you take?

Which TWO of the following statements regarding the Spark SQL 'DataFrame.write' operation are accurate?

Which of the following functions is best suited for extracting the year from a timestamp column in Spark SQL?

Which THREE of the following are valid ways to improve the performance of a Spark SQL query that scans a large partitioned table?

Question 11easymultiple choice
Read the full Using Spark SQL explanation →

Which function is the most appropriate way to convert a string column containing date information into a proper DateType column in Spark SQL?

You are working with a Delta table. Which TWO of the following commands are valid ways to improve query performance for frequently filtered columns in Spark SQL?

When creating a Delta table using the 'CREATE TABLE' statement in Spark SQL, which THREE of the following features are supported natively?

Question 14mediummultiple choice
Read the full Using Spark SQL explanation →

You are performing a join between a large table and a table with high cardinality. Which technique should you use to avoid memory pressure on a single node during the join?

Which TWO of the following are benefits of using the Delta Lake format over Parquet for Spark SQL operations?

Question 16mediummultiple choice
Read the full Using Spark SQL explanation →

You need to query a Delta table named `sales_data` using Spark SQL and flatten an array column named `items` into multiple rows while preserving the rest of the record structure. Which function should you use?

Which TWO of the following statements regarding the behavior of the 'MERGE INTO' command in Databricks SQL are correct?

Question 18mediummultiple choice
Read the full Using Spark SQL explanation →

You are querying a large partitioned table in Databricks using Spark SQL and need to permanently register the filtered output as a new table in the Hive metastore while avoiding a full table scan. Which statement correctly achieves this persistence?

Question 19mediummultiple choice
Read the full Using Spark SQL explanation →

You need to persist a temporary view in Spark SQL so that it is available across different sessions within the same Spark application. Which command should you execute?

You have a large Delta table and need to optimize query performance for frequently filtered columns. Which TWO actions should you take?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Using Spark SQL sessions

Start a Using Spark SQL only practice session

Every question in these sessions is drawn from the Using Spark SQL domain — nothing else.

Related practice questions

Related Databricks-Spark-Assoc topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the Databricks-Spark-Assoc exam test about Using Spark SQL?
Be able to write correct Spark SQL SELECT queries with WHERE, GROUP BY, and HAVING, create DataFrames from tables through the catalog, and tune Delta writes and driver memory. The key is knowing HAVING filters aggregates while WHERE filters rows before grouping.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Using Spark SQL questions in a focused session?
Yes — the session launcher on this page draws every question from the Using Spark SQL domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other Databricks-Spark-Assoc topics?
Use the topic links above to move to related areas, or go back to the Databricks-Spark-Assoc question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the Databricks-Spark-Assoc exam covers. They are not copied from any real exam or dump site.