CertLumen

Microsoft Fabric Data Engineer (DP-700) · Section 2 · 33% of the exam

Group and aggregate data

One of the objectives of the Microsoft Certified: Fabric Data Engineer Associate (exam DP-700: Implementing Data Engineering Solutions Using Microsoft Fabric) exam, in the section “Ingest and transform data”. Here is what it covers, the points to remember and a question to try.

What it covers

The same four jobs appear in every engine: reshape and join data, denormalize it for analytics, group and aggregate it, and make it trustworthy by removing duplicates, filling gaps and absorbing late arrivals. This lesson shows each in PySpark, T-SQL or Spark SQL, and KQL, and which approach suits which store.

Points to remember

  • Transformations are equivalent across engines: filter, join, group (summarize), window and write.
  • Use built-in Spark functions instead of Python UDFs; PySpark is lazy until an action runs.
  • Denormalize dimensions (wide, flat attributes); keep fact tables narrow with keys and measures.
  • Flatten nested JSON with dot notation and explode; broadcast the small side of a join.
  • Exact duplicates: distinct or dropDuplicates; duplicate keys: row_number over a window (QUALIFY in T-SQL, arg_max in KQL).

Try a question

A warehouse report needs revenue per region and month, a subtotal per region and a grand total, in a single query. Which T-SQL construct provides the subtotals?

  1. AGROUP BY RegionName, MonthStart HAVING COUNT(*) > 1
  2. BSELECT DISTINCT RegionName, MonthStart
  3. CGROUP BY ROLLUP (RegionName, MonthStart)
  4. DPARTITION BY RegionName, MonthStart
Show the answer

C. ROLLUP, CUBE and GROUPING SETS produce subtotals and grand totals in one pass. In PySpark use rollup() and cube(); KQL has no rollup, so you union separate summarize results.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Transforming data with PySpark, SQL and KQL teaches this objective (about 55 minutes), and 18 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 49 objectives · Next objective →