Inflexion

Amazon

Amazon's AI SQL generator changes who can use retail data

Amazon Marketing Cloud added natural-language audience building and a five-year purchase lookback.

Inflexion19 September 20268 min read
Rows of server cabinets in a data centre

The important part of Amazon's SQL generator is not that it writes SQL faster. It changes who can turn a commercial question into an audience definition.

The release is a user-interface change with strategic consequences

At CES 2025, Amazon Ads announced a generative AI SQL generator for Amazon Marketing Cloud. An advertiser describes an audience or analysis in ordinary language. The tool returns a query and shows the steps used to create it. The query can then be run in AMC and the audience activated in Amazon DSP and the Ads Console.

Amazon's example is specific: find customers who viewed a product page and saw a streaming TV ad but did not purchase in the last 30 days. That audience could support retargeting across streaming TV, audio and sponsored product activity.

The immediate benefit is faster query creation. The larger change is that audience design no longer begins with a specialist who already knows the schema. It begins with a question that the specialist can inspect, test and refine.

Access is the change

Retail data has always been valuable and difficult to use. It sits behind privacy controls, unfamiliar tables and platform-specific identifiers. A brand may know the audience it wants but lack the SQL skills or AMC experience to express it.

Natural-language querying lowers that barrier. More people can ask questions of purchase, exposure and engagement signals. More people can also create flawed questions at speed.

The role of the analyst moves. Instead of writing every query, the analyst defines the data model, checks the generated logic, and helps the team understand what the result can support.

Five years changes the question

Amazon also announced a five-year retail purchase lookback in AMC, up from 13 months, initially in limited beta as a paid feature.

That matters for products with long replacement cycles and seasonal categories. A laptop buyer may not purchase again for several years. A household buying across laundry and cleaning categories may show value only when the portfolio is viewed together.

The longer history allows questions that a 13-month window could not answer reliably:

  • Which product acts as the first purchase in a portfolio?
  • Which exposures precede a second category purchase?
  • Does new-to-brand behaviour persist beyond the campaign period?
  • Which seasonal audiences return the following year?

Amazon later described a 25-month ad-traffic lookback for AMC, separate from the five-year retail purchase feature. That distinction matters. Purchase history answers questions about customer value. Ad-traffic history answers questions about exposure and sequence. Joining the two is where the analysis becomes useful.

Where the query can mislead

Natural language hides assumptions. "Customers who saw an ad" could mean an impression was served, a video reached a completion threshold, or a household was matched across signals. "Did not purchase" could refer to one product, a brand, a category or the whole store.

A generated query may be syntactically valid and commercially wrong. Before activating an audience, check:

  1. What event defines exposure?
  2. What event defines purchase?
  3. Which time zone and lookback window apply?
  4. How are household and device identities joined?
  5. What is the eligible audience size and suppression logic?

The generator returns the steps it used. That makes review possible, but it does not make review optional.

A better workflow

Use the generator as the first draft of a question, not the last step before activation.

  1. Write the commercial decision in plain language.
  2. Define the audience in plain language, including exclusions.
  3. Generate the SQL and read the steps, not just the output.
  4. Check the query against the AMC schema and a known sample.
  5. Run a small validation before activation.
  6. Record the query, audience definition, date and result.

This workflow gives non-technical teams access without removing technical accountability. It also produces a useful record of how an audience was built, which becomes more important as the number of automated segments increases.

Amazon's AI SQL generator is a sign of where retail media is going. The scarce skill will not be the ability to write a query. It will be knowing which question is worth asking, what the data can actually answer, and when the result is too weak to activate.

Inflexion PerspectivesAnalysis from the Inflexion team on AI search, media and measurement.

See where media budget is working across the journey.

The media audit reviews spend, measurement and shelf readiness across every stage, from first impression to the retailer shelf.