NL-to-PL/SQL Basic (nl2plsql-basic)
This is the 基础版 (free) NL-to-PL/SQL skill. It handles basic tasks only.
NL-to-PL/SQL is translating a natural-language requirement into a procedural extension of SQL (broadly "PL/SQL"). This skill covers two dialects:
- Oracle PL/SQL
- PostgreSQL PL/pgSQL
What basic covers (free)
- Read and inspect NL-to-PL/SQL seed data in the canonical JSON format.
- Write a simple Oracle PL/SQL or PostgreSQL PL/pgSQL stored procedure or function that performs a single SQL statement: one
SELECT ... INTO, oneINSERT(values orINSERT ... SELECT), oneUPDATE, or oneDELETE, with basicIN/OUT/RETURNparameters. - Write basic
IF ... THEN ... ELSIF ... ELSE ... END IFcontrol flow around a single statement. - Apply the core Oracle↔PostgreSQL differences (see
references/dialect-basics.md).
What basic does NOT cover (requires paid nl2plsql-pro)
Do not attempt these in the basic tier; tell the user they require the paid version nl2plsql-pro:
- Triggers (Oracle
CREATE TRIGGER; PostgreSQL trigger functions +CREATE TRIGGER). - Complex procedural logic: cursors, loops beyond a trivial
IF, exception handling, dynamic SQL, transaction control. - Multi-statement bodies beyond a single SQL operation.
- Data generation: template-based or multi-granularity (goal/requirement/implementation) NL-to-PL/SQL data generation.
- Prompt construction: schema pruning, metadata enrichment, chain-of-thought, skeleton prediction.
- Model training: incremental pre-training, SFT, reinforcement learning, error correction.
- Evaluation: execution-match (EX) / exact-match (EM) / execution-accuracy metrics, call suites.
- ProcArena scenarios (A1–A5, B1–B4) and Direct/Interactive modes.
If a request mixes basic and advanced parts, complete only the basic parts and clearly flag the advanced parts as requiring nl2plsql-pro.
Canonical seed-data format
The seed files are JSON objects with three top-level keys: procedure, function, trigger. Each value is a list of records:
{
"ir": "<natural-language instruction>",
"plsql": "<target Oracle PL/SQL or PostgreSQL PL/pgSQL code>",
"database_name": "<snake_case database identifier>",
"tables": ["<relevant table name>", "..."]
}
iris the NL instruction (input);plsqlis the ground-truth code (output).tableslists only the table names relevant to that record; column-level schema lives elsewhere.- Read references/data-format.md before loading these large (~48–57 MB) files.
References
- references/data-format.md — seed JSON format, scale, and reading tips.
- references/dialect-basics.md — minimal Oracle PL/SQL and PostgreSQL PL/pgSQL syntax for simple procedures/functions, plus core differences.
Quick utility
scripts/inspect_seed.py prints per-construct counts, distinct-database counts, average table count, and a few samples for any seed JSON.