Tutorial D

1 program Added 2026-02-08T21:26:47Z Agent: claude-codeModel: opusWebSearch: disabled Evidence Report issue View issues
Aliases: TutorialD
Provenance: commit a67d0e8356 · authored 2026-02-08T22:27:31+01:00 · agent claude-code · model opus

Sources mentioning this language

3 sources · pl_id: pl/tutorial-d
LLM (this repo) · 1PldbRosettacode

Related languages

Rel (0.40)TUTOR (0.29)Emerald (0.14)Meld (0.11)Teal (0.11)

LLM-contributed programs

Suppliers and Parts Database

Provenance: commit a67d0e8356 · authored 2026-02-08T22:27:31+01:00 · agent claude-code · model opus · WebSearch disabled
code.d · added: 2026-02-08T21:26:47Z
VAR S REAL RELATION { SNO CHAR, SNAME CHAR, STATUS INTEGER, CITY CHAR } KEY { SNO };
VAR P REAL RELATION { PNO CHAR, PNAME CHAR, COLOR CHAR, WEIGHT RATIONAL, CITY CHAR } KEY { PNO };
VAR SP REAL RELATION { SNO CHAR, PNO CHAR, QTY INTEGER } KEY { SNO, PNO };

S := RELATION {
  TUPLE { SNO "S1", SNAME "Smith", STATUS 20, CITY "London" },
  TUPLE { SNO "S2", SNAME "Jones", STATUS 10, CITY "Paris" },
  TUPLE { SNO "S3", SNAME "Blake", STATUS 30, CITY "Paris" },
  TUPLE { SNO "S4", SNAME "Clark", STATUS 20, CITY "London" },
  TUPLE { SNO "S5", SNAME "Adams", STATUS 30, CITY "Athens" }
};

P := RELATION {
  TUPLE { PNO "P1", PNAME "Nut", COLOR "Red", WEIGHT 12.0, CITY "London" },
  TUPLE { PNO "P2", PNAME "Bolt", COLOR "Green", WEIGHT 17.0, CITY "Paris" },
  TUPLE { PNO "P3", PNAME "Screw", COLOR "Blue", WEIGHT 17.0, CITY "Oslo" },
  TUPLE { PNO "P4", PNAME "Screw", COLOR "Red", WEIGHT 14.0, CITY "London" },
  TUPLE { PNO "P5", PNAME "Cam", COLOR "Blue", WEIGHT 12.0, CITY "Paris" },
  TUPLE { PNO "P6", PNAME "Cog", COLOR "Red", WEIGHT 19.0, CITY "London" }
};

SP := RELATION {
  TUPLE { SNO "S1", PNO "P1", QTY 300 },
  TUPLE { SNO "S1", PNO "P2", QTY 200 },
  TUPLE { SNO "S1", PNO "P3", QTY 400 },
  TUPLE { SNO "S1", PNO "P4", QTY 200 },
  TUPLE { SNO "S2", PNO "P1", QTY 300 },
  TUPLE { SNO "S2", PNO "P2", QTY 400 },
  TUPLE { SNO "S3", PNO "P2", QTY 200 },
  TUPLE { SNO "S4", PNO "P2", QTY 200 },
  TUPLE { SNO "S4", PNO "P4", QTY 300 }
};

// Suppliers in London
(S WHERE CITY = "London") { SNAME };

// Natural join of suppliers and shipments, projected on supplier name and part number
(S JOIN SP) { SNAME, PNO };

// Suppliers who supply part P2
(SP WHERE PNO = "P2") { SNO } JOIN S { SNO, SNAME };

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Tutorial D (mapped to pl/tutorial-d). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Tutorial D/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← TUTOR Tuvars →