Developer ToolsFree generatorPDF, Excel, Word exportSemiconductors

Semiconductor Lot Yield and Bin Pareto SQL Query Generator

This generator writes three SQL queries every yield engineer ends up writing: weekly yield by product, a bin Pareto of failing bins, and a list of the lowest-yield lots. You enter your own table and column names, and the queries update instantly.

Fill in

Generated code
Download:

Weekly yield by product

SELECT product AS product,
       DATE_TRUNC('week', test_time) AS test_week,
       COUNT(*) AS dies_tested,
       SUM(CASE WHEN hard_bin = 1 THEN 1 ELSE 0 END) AS dies_good,
       ROUND(100.0 * SUM(CASE WHEN hard_bin = 1 THEN 1 ELSE 0 END) / COUNT(*), 2) AS yield_pct
FROM die_test_results
WHERE product = 'MCU-A32'
  AND test_time >= DATE '2026-07-01'
  AND test_time < DATE '2026-10-01'
GROUP BY product, DATE_TRUNC('week', test_time)
ORDER BY test_week;

Bin Pareto (failing bins only)

SELECT hard_bin AS bin,
       COUNT(*) AS die_count,
       ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER (), 2) AS pct_of_fails,
       ROUND(100.0 * SUM(COUNT(*)) OVER (ORDER BY COUNT(*) DESC) / SUM(COUNT(*)) OVER (), 2) AS cumulative_pct
FROM die_test_results
WHERE product = 'MCU-A32'
  AND hard_bin <> 1
  AND test_time >= DATE '2026-07-01'
  AND test_time < DATE '2026-10-01'
GROUP BY hard_bin
ORDER BY die_count DESC;

Lowest-yield lots

SELECT lot_id AS lot,
       COUNT(*) AS dies_tested,
       ROUND(100.0 * SUM(CASE WHEN hard_bin = 1 THEN 1 ELSE 0 END) / COUNT(*), 2) AS yield_pct
FROM die_test_results
WHERE product = 'MCU-A32'
  AND test_time >= DATE '2026-07-01'
  AND test_time < DATE '2026-10-01'
GROUP BY lot_id
HAVING COUNT(*) >= 5000
ORDER BY yield_pct ASC
LIMIT 20;

Table and column names are generic placeholders for your own schema; real test data systems differ widely. The syntax targets PostgreSQL (DATE_TRUNC, LIMIT). For SQL Server use DATEADD/DATEDIFF and TOP, for Oracle use TRUNC(date, 'IW') and FETCH FIRST. Retests and multiple probe passes can double count dies, so filter to the final test pass first.

Ask your yield data in plain language

Optional: a look at read-only natural-language access to test and ERP data on your own servers.

Optional. The tool and every export work without this. No spam.

How to use it

Enter the name of your die level results table and the columns for lot, product, bin and test time. Set the passing bin, the product and the date range, then copy the queries into your SQL client. If your test data is stored per wafer rather than per die, adapt the counts to use die count columns and sum them instead of counting rows.

  • Use the exclusive end date to avoid double counting boundary days
  • Set a minimum die count to hide tiny lots in the worst-lot list
  • Run the weekly trend first, then drill into the Pareto

The yield and Pareto logic

Yield here is good dies divided by dies tested, expressed as a percentage. The Pareto query counts failing dies by bin, then adds a running cumulative percentage so you can see which two or three bins explain most of the loss. This is the standard first step before chasing a root cause with wafer maps or parametric data.

Retests and probe passes

Many flows probe a wafer more than once. If your table keeps every pass, a raw count mixes first-pass and retest results, and yield looks wrong. Filter to the last pass for each die, or keep separate first-pass and final-yield views. Also confirm whether bin numbers are hard bins or software bins, since they answer different questions.

Common mistakes

Dividing by wafers instead of dies, mixing products with different die sizes, and averaging lot yields without weighting by die count all distort results. Use total good divided by total tested across the period. Check the time zone of the test time column when grouping by week.

Frequently Asked Questions

Will this work with my test database schema?

Only after you set your own table and column names. The names are generic placeholders. If your data is per wafer or per bin summary, you will need to adjust the counting logic.

Which SQL dialect is generated?

PostgreSQL style syntax. For SQL Server or Oracle, swap the week truncation and row limit functions as listed in the notes.

Why use a minimum die count for lots?

Small lots can show extreme yields by chance. A minimum die count keeps the worst-lot list focused on lots with enough data to be meaningful.

Can I use this for final test or OSAT data?

Yes, if you have a unit level result table with product, lot, bin and test time. Replace die with unit in your thinking and change the table and column names.

If you want yield questions answered in plain language from your test database or ERP, Netray can set this up on-prem with read-only access.