Back to results
Explore the library298 guides total · goals, work & tasks
By goal

Choose what you want to achieve.

By work or interest

Choose a setting you work or spend time in.

By task

Choose the kind of help you want.

Counts show all available guides. Filters combine to narrow your results.

Build a workflowGuide

Turn a data question into a read-only query you can check

Write a small SQLite SELECT and compare it with an answer you derived from every row.

Illustrative resourceNot tool-testedAdults working with original, synthetic or authorized non-sensitive material
What you’re working towards

Expect two proposed SQLite queries, row-by-row reasons and an independent expected list for each query.

Download playbook .md

Your choice also saves this guide’s current worked-example checkmarks. Only this browser; no account or sync. View saved guides

Saving needs JavaScript. Reading and downloading this guide does not save it.

Make a start

One step at a time.

2 steps

Start with the synthetic worked example or other non-sensitive inputs. Run one prompt at a time in your chosen AI tool. Replace any bracketed placeholders with the requested material, check each reply, and supply the source or earlier outputs that step needs. Paste them again if the tool lacks that context.

Start with the synthetic example, then adapt each prompt to your task.

01

Try the complete example

Open a new chat in a text AI assistant you already have permission to use. Copy the whole prompt below, including SAMPLE INPUT, and send it. No file upload is needed. Expect two proposed SQLite queries, row-by-row reasons and an independent expected list for each query. Read the Input beside the reply; the Output is a worked illustration, not text to paste. Derive A and B from known quantities 0 and 3; keep C in a separate missing-value list, and exclude D at 5. The first comparison is strictly less than 4. The missing-value query uses IS NULL, not = NULL; no query fills NULL with zero or silently removes duplicates. Both queries select item_id only and explicitly sort it. Read the boundary probes as proposed checks; no consumer AI or database session is established by this text. If something differs, quote the wrong part and the exact source rule. Ask for a complete corrected replacement, then check it yourself. If a rule needed to finish is missing, keep that part unresolved and ask the owner. Save the checked draft separately; do not overwrite the input.

Your starting prompt
Using only the complete table and rules below, first derive the expected row lists by reading every row. Then draft the two SELECT queries, explain their conditions and write the requested boundary probes. Explain unfamiliar terms plainly.

SAMPLE INPUT
ORIGINAL SYNTHETIC TABLE AND QUESTION
SQL is a language for asking a database for rows. SELECT asks for a result; WHERE applies a condition; ORDER BY names the sorting rule. In this exercise you only draft and check the written query. Do not connect to a database.

D1. Dialect: SQLite. Table name: stock. Columns: item_id TEXT and qty INTEGER. All item_id values in this complete example are distinct nonempty ASCII strings. The quantities are stored integers or SQL NULL, not text. SQL NULL means a quantity was not supplied; it is not the word "NULL" and is not zero.
D2. Complete rows, in this source order:
item_id | qty
D | 5
C | NULL
A | 0
B | 3
D3. Question: return item_id only for every known quantity strictly less than 4, sorted by item_id ascending using SQLite's BINARY ordering. Also return a separate sorted item_id list for unknown quantities. Do not change or combine the source rows, fill unknowns or infer stock actions.
D4. Derive both expected result lists from these four records before writing queries. Explain each row's inclusion or exclusion. Return one SELECT query for each list; no schema creation, database connection, write command or function with side effects. No actual execution result has been supplied.
D5. Name checks for zero, exactly 4, NULL, empty result and repeated output IDs. The baseline has no duplicate IDs; a later repeated ID must not silently disappear through DISTINCT. Any new rule about duplicates needs to be supplied explicitly.

Return the full requested written result. Keep every proposed test marked not run. Do not invent application behavior, observations or successful execution. Do not connect to any service or run commands.
02

Use your own input

Open a new chat. Replace every bracketed field below with your complete input, then paste the whole prompt. Change related names, source IDs, counts, limits and checks together; sample values do not carry over. Use original, synthetic or authorized non-sensitive material. Do not include credentials, personal identifiers or private customer records. Read each of your own rows without using the query result as the answer key. Keep missing values separate from known zero, compare exact boundaries, and account for duplicate output rows under your supplied rule. Check the displayed query against your exact schema and sorting requirement. If something differs, quote the wrong part and the exact source rule. Ask for a complete corrected replacement, then check it yourself. If a rule needed to finish is missing, keep that part unresolved and ask the owner. Save the checked draft separately; do not overwrite the input.

Your starting prompt
Draft only SQLite SELECT queries for my supplied synthetic table and question. First derive expected results by inspecting every source row; then write the queries and explain where each row goes. Preserve stored value types, NULL meaning, duplicates and sorting rules exactly. Ask about missing semantics before drafting an answer. Include strict-boundary, missing-value and empty-result checks applicable to my rule, all labeled proposed. Do not connect to a database, create a schema, run commands or make changes. If my dialect is not SQLite, stop this route until its official syntax is checked.

MY INPUT
Exact SQL dialect and complete synthetic schema: [replace with complete non-sensitive details, or explicitly state unknown]
Complete synthetic source rows and stored value types: [replace with complete non-sensitive details, or explicitly state unknown]
Question, output columns and sorting rules: [replace with complete non-sensitive details, or explicitly state unknown]
Meaning of missing values and duplicate-row policy: [replace with complete non-sensitive details, or explicitly state unknown]
Thresholds and exact boundary rules: [replace with complete non-sensitive details, or explicitly state unknown]
Draft-only scope; no database connection or execution: [replace with complete non-sensitive details, or explicitly state unknown]

Use only MY INPUT for facts and rules. Ask for essential missing details instead of inventing them. Do not import sample values. Return the complete written result and questions that remain. Do not open or connect to an application, run a test, send, publish, upload, or change another service.
Optional: improve the result

Include the threshold without hiding unknowns

This optional extension uses only the original synthetic sample. Return to the sample chat, or paste the complete Input and your checked sample answer into a new chat first. Keep the original edition for comparison. No result of this extension has been observed. For personal inputs, replace the source and all dependent rules and checks together.

Advanced prompt
Using the original sample Input and checked answer, create a separate revision that changes only the known-quantity condition to less than or equal to 4. Keep the missing list, output column and BINARY sort unchanged. Show the revised query. Explain why the original four rows cannot distinguish the old and new conditions, then supply a separate one-row probe item_id E, qty 4 with the expected difference. Do not change the baseline source or claim any query ran.
Show, then try

See the shape of the result.

This input is synthetic. The output is a written illustration of the intended result, not a verified AI-tool run.

The starting point

Synthetic input
ORIGINAL SYNTHETIC TABLE AND QUESTION
SQL is a language for asking a database for rows. SELECT asks for a result; WHERE applies a condition; ORDER BY names the sorting rule. In this exercise you only draft and check the written query. Do not connect to a database.

D1. Dialect: SQLite. Table name: stock. Columns: item_id TEXT and qty INTEGER. All item_id values in this complete example are distinct nonempty ASCII strings. The quantities are stored integers or SQL NULL, not text. SQL NULL means a quantity was not supplied; it is not the word "NULL" and is not zero.
D2. Complete rows, in this source order:
item_id | qty
D | 5
C | NULL
A | 0
B | 3
D3. Question: return item_id only for every known quantity strictly less than 4, sorted by item_id ascending using SQLite's BINARY ordering. Also return a separate sorted item_id list for unknown quantities. Do not change or combine the source rows, fill unknowns or infer stock actions.
D4. Derive both expected result lists from these four records before writing queries. Explain each row's inclusion or exclusion. Return one SELECT query for each list; no schema creation, database connection, write command or function with side effects. No actual execution result has been supplied.
D5. Name checks for zero, exactly 4, NULL, empty result and repeated output IDs. The baseline has no duplicate IDs; a later repeated ID must not silently disappear through DISTINCT. Any new rule about duplicates needs to be supplied explicitly.

Copies text only. For image or file tasks, use the source files named in the steps too.

Download source .txt

The intended result

Illustrative output
Illustrative answer authored for this guide; not a recorded AI response.

Expected results derived from the four source records
Known qty < 4, sorted item_id: A, B.
Unknown qty, sorted item_id: C.
D (5): excluded from both lists because 5 is known and not below 4.
C (NULL): included only in the unknown list; missing is not zero.
A (0): included in the below-4 list because zero is a known value below 4.
B (3): included in the below-4 list because 3 is below 4.

Proposed query for known quantities below 4:
SELECT item_id
FROM stock
WHERE qty < 4
ORDER BY item_id COLLATE BINARY ASC;

Proposed query for unknown quantities:
SELECT item_id
FROM stock
WHERE qty IS NULL
ORDER BY item_id COLLATE BINARY ASC;

Why these conditions work: qty < 4 is true for A and B. For C it evaluates to NULL, so the WHERE filter does not keep C. IS NULL is the explicit missing-value test. The written comparison qty = NULL is not a substitute. There is no DISTINCT because no instruction permits discarding repeated result rows. The explicit ordering avoids relying on source order.

Separate proposed boundary probes, each in a new synthetic copy; NOT RUN as part of this AI workflow:
B1: Replace D's qty 5 with 4. D must still be excluded from both lists because the limit is strictly below 4.
B2: Replace C's NULL with numeric 0. Known result becomes A, B, C; unknown result becomes empty. Do not make this replacement in the original.
B3: Replace A and B quantities with 4, keeping C unknown and D at 5. Known result becomes empty; unknown result stays C.
B4: Append one additional synthetic row item_id A, qty 2, under an explicit changed-fixture instruction to preserve repeated output rows. Known result becomes A, A, B; unknown result stays C. Neither a silent DISTINCT nor deduplication is allowed. The relative order of the two identical A output values is immaterial because the output contains only item_id.

This is a proposed query and a manually derived answer key, not a database-session receipt. Official SQLite syntax and NULL behavior can be checked from the linked documentation. A real implementation or another SQL dialect needs separate review; never try this against a production database to complete the lesson.
Download result .txt
You’re the final check

Check the worked example.

These checks use the worked example and its particular facts. With your own material, check your actual names, numbers, sources and rules; do not reuse the sample’s values as the answer.

Unsaved checks stay in this tab and reset when you reload. If you choose Save guide, its current example checkmarks are kept in this browser when storage is available.

A few things to watch for.

  • Treating missing values as zero invents a known quantity.
  • A plausible query can still answer the wrong question. Derive the expected result independently, including exact-threshold and duplicate cases.

What has been checked?

Documentation
Reviewed 2026-10-14. Source review is not workflow execution.
Included files
No scoped artifact-check record.
AI workflow
Not run in a recorded consumer-AI workflow.
Time savings
Time savings not measured
Read the scope and evidence

SQLite SELECT ↗ (opens in a new tab)

2026-10-14 · confirmed

SELECT produces result rows; WHERE retains true rows and excludes false or NULL; ORDER BY specifies result sorting.

Limits: Official documentation read only. This does not establish a consumer AI run, database connection, permission to run against real data, or a provider plan.

SQLite expressions ↗ (opens in a new tab)

2026-10-14 · confirmed

Ordinary comparisons with NULL produce NULL; IS NULL explicitly tests whether a value is NULL.

Limits: Official documentation review; no actual AI workflow or production database tested.

Copy these instructions

Your browser blocked automatic copying. Select the text below and copy it.