A JOIN that quietly double-counts orders shows why the FDE role treats Python and SQL as the baseline and checking keys first as a habit.

Key takeaways

  • Customer data is usually messy, so SQL is first a tool for inspecting data, and only second a tool for producing reports.
  • The most dangerous errors are wrong JOINs: they raise no errors, yet duplicate rows or lose data.
  • Python turns these checks into repeatable code with assert; only then can you talk about turning them into a product.

On Monday, you get read-only access to the customer's Postgres database. At noon, their sales lead asks for revenue broken down by region. You write a JOIN between the

orders

and

customers

tables, it runs in three seconds, and you send the results over.

In the afternoon, the phone rings: your total revenue is higher than finance's number. The query has no syntax errors and throws no errors at all. It simply counted some orders twice, and nobody told you.

Situations like this are why Python and SQL are considered the baseline for Forward Deployed Engineer (FDE) work. You don't need to master a long list of frameworks. What you need is a habit: inspect the data before trusting it, plus enough skill to write those checks as code that can run repeatedly.

What do job descriptions say about this baseline?

Capicua describes FDE work as writing production code that runs directly on customer infrastructure and data. Job postings point in the same direction, differing mainly in whether they name SQL explicitly.

Databricks explicitly lists Python and SQL in the requirements for its Sr. FDE role in Singapore, and also expects FDEs to integrate AI APIs like OpenAI, Anthropic, and Gemini into applications. Palantir requires proficiency in a language such as Python, Java, or C++, and specifically mentions using Python for data processing and analysis, but doesn't mention SQL.

However, another Palantir posting mentions Postgres, Cassandra, Hadoop, and Spark. Paraform sums it up as: one backend language, plus the ability to quickly pull and wrangle data.

When reading job descriptions, watch for phrases like "pull and wrangle data" or "data processing," or specific systems like Postgres and Spark. They mean you'll be working directly with real data. Even AI API integration is built on data; if the data is wrong, the product will be wrong too.

The key word is "customer's": this data was designed by someone else, and you have no idea how many generations of systems have modified it.

Why is SQL first an inspection tool?

HCL GUVI calls SQL one of the most practical skills for an FDE. The reason is that customer environments are full of databases, business records, and inconsistent data. It also warns that a badly written JOIN can create duplicate records or silently erase important information.

Its advice: investigate customer data rather than assuming it's trustworthy.

So an FDE's SQL has two tasks. The first is to question the data: are the keys really unique? Will the JOIN inflate the row count? Are any rows being dropped? Only after that comes answering business questions.

Example: dissecting an inflated revenue figure

Back to Monday afternoon. Suppose the

customers

table has three columns:

customer_id

、

region

and

updated_at

. The first question is:

customer_id

is it really a unique key? (The column aliases below mean:

row_count

is row count,

customer_count

is customer count,

record_count

is record count.)

-- 1. 键是否唯一?
SELECT COUNT(*) AS row_count,
       COUNT(DISTINCT customer_id) AS customer_count
FROM customers;

-- 如果 row_count > customer_count,查看哪些客户重复
SELECT customer_id, COUNT(*) AS record_count
FROM customers
GROUP BY customer_id
HAVING COUNT(*) > 1
ORDER BY record_count DESC
LIMIT 10;

Suppose the result shows some customers have two or three records: every time an address changed, the system inserted a new row instead of updating the existing one. Every order for these customers gets doubled in the JOIN. That's where the extra revenue comes from.

The next step is to measure the JOIN's impact directly instead of guessing:

-- 2. JOIN 是否改变了行数?
SELECT
  (SELECT COUNT(*) FROM orders) AS before_join,
  (SELECT COUNT(*) FROM orders o
     JOIN customers c ON c.customer_id = o.customer_id) AS after_join;

-- 3. 是否有订单找不到对应客户(INNER JOIN 会丢掉这些订单)?
SELECT COUNT(*) AS unmatched_orders
FROM orders o
LEFT JOIN customers c ON c.customer_id = o.customer_id
WHERE c.customer_id IS NULL;
before_join

(before the JOIN) and

after_join

(after the JOIN) must be equal. If

after_join

is larger, rows were duplicated. If

unmatched_orders

(the number of unmatched orders) is greater than 0, the original INNER JOIN is silently dropping those orders.

The fix: keep only the latest record per customer, and switch to a LEFT JOIN so no order is lost.

WITH cust AS (
  SELECT customer_id, region,
         ROW_NUMBER() OVER (PARTITION BY customer_id
                            ORDER BY updated_at DESC) AS rn
  FROM customers
)
SELECT COALESCE(cust.region, '(未知)') AS region,
       SUM(o.amount) AS revenue
FROM orders o
LEFT JOIN cust ON cust.customer_id = o.customer_id AND cust.rn = 1
GROUP BY 1
ORDER BY revenue DESC;
(未知)

This row isn't an error to hide; it's a finding to bring back to the customer: how many orders can't be linked to any customer, and why.

Python makes the checks repeatable

The SQL above is only good for today. Next week, new data arrives, and you need these checks to run automatically and fail automatically when something's wrong. That's where Python comes in, and it's where Palantir's "data processing and analysis" requirement becomes concrete.

import os
import pandas as pd
from sqlalchemy import create_engine

engine = create_engine(os.environ["CUSTOMER_DB_URL"])

orders = pd.read_sql("SELECT order_id, customer_id, amount FROM orders", engine)
customers = pd.read_sql(
    "SELECT customer_id, region, updated_at FROM customers", engine
)

# 每个客户保留最新一条记录
customers = (customers.sort_values("updated_at")
                      .drop_duplicates("customer_id", keep="last"))

# 如果 customers 一侧仍有重复键,validate 会报错
merged = orders.merge(customers, on="customer_id",
                      how="left", validate="many_to_one")
assert len(merged) == len(orders), "JOIN 改变了行数"

unmatched_rate = merged["region"].isna().mean()
print(f"未匹配到客户的订单占比:{unmatched_rate:.1%}")

report = (merged.fillna({"region": "(未知)"})
                .groupby("region")["amount"].sum()
                .sort_values(ascending=False))

The three most valuable lines here are:

validate="many_to_one"

, which raises an error if the customers side still has duplicate keys;

assert

, which fails if the JOIN changed the row count; and the line that prints the proportion of unmatched orders. Together, they turn Monday afternoon's lesson into hard requirements. The next time the data breaks, the data pipeline will stop before wrong numbers reach the customer.

What order should you do things in?

Follow the same sequence every time you encounter a new customer table. First count rows and distinct keys to confirm whether the keys are truly unique. Then measure the row counts before and after each JOIN, and use a LEFT JOIN plus

IS NULL

to count dropped records.

Once you find a problem, fix it at the query level: use ROW_NUMBER(), or a record-selection rule confirmed with the customer. Finally, move all the checks into Python as asserts, and when reporting, always present the proportion of unmatched data alongside the totals, not just the totals.

Common mistakes

The most common mistake is using INNER JOIN out of habit. It looks clean, but it drops exactly the records you need to see. Another mistake is deciding the deduplication rule yourself: "take the latest record" is a business decision; ask the customer instead of guessing.

Another mistake is patching things up by adding

SELECT DISTINCT

at the end of the query. It masks the symptom without telling you the cause, and it may merge rows that were actually different.

The last mistake is checking manually in a notebook without saving it as a script. Next week, when the data changes, the old bug comes back, and nobody remembers what was checked.

How to show this skill on your resume

For developers who want to move into an FDE role, writing "proficient in Python and SQL" on a resume says almost nothing. A more convincing approach is to tell a story: discovered duplicate keys in a customer table that inflated reported revenue; wrote automated checks in pandas; reported the proportion of unmatched orders to the operations team.

This week's exercise

Find a real database you have read-only access to, either at work or a public dataset with at least two related tables. Pick a reporting query you or a colleague wrote, run the three checks above on it, then rewrite it as a Python script with

validate

and

assert

.

If all three checks pass, you have evidence the numbers are correct. If they don't, you found the bug before the customer did, and that's exactly what an FDE does.

Was this article helpful?

Thanks for your feedback!

6 sources

Next on the roadmap · Phase 1: Foundational Understanding — FDE projects define the "why" and the "what" before writing code. Databricks anchors projects with OKRs shared with customers before starting work; a one-page, three-tier project brief can serve the same purpose.