{"id":79558,"plugin_id":"plugins_6ab40fcbcc3c81919e0c679fee35faaf","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-04T00:11:25.602Z","digest":"0c4c5d44bea2293e0453e6c1c7221284dde23edbb7b20cd9b359d2d262c73800","against":null,"payload":{"description":"Design and debug SQL joins, bridge tables, duplicate amplification and semi-join decisions.","included_files":[],"name":"join-cardinality","skill_md_contents":"---\nname: join-cardinality\ndescription: Design and debug SQL joins, bridge tables, duplicate amplification and semi-join decisions.\n---\n\n# Join Cardinality\n\n**Trigger:** Design and debug SQL joins, bridge tables, duplicate amplification and semi-join decisions.\n\n## Workflow\n1. Declare the row grain for each input and the desired output.\n2. Check uniqueness of join keys on each side and whether null keys, duplicates or slowly changing versions exist.\n3. Compare inner, outer, existence/semi-join and pre-aggregation shapes. Explain when join conditions in WHERE can unintentionally turn LEFT JOIN into an INNER JOIN.\n4. For many-to-many, identify the legitimate bridge keys and the measurement grain. Avoid summing order-level measures after joining multiple item rows.\n5. Recommend a probe that counts input and output rows and verifies measure conservation.\n\n## Critical standard\nDetect source-side duplicates before MERGE and do not silently force one-to-one assumptions.\n\n## Evidence and execution\nOnly say \"executed\", \"passed\", \"observed\", \"optimized\" or \"deployed\" when a connected tool returned evidence for that claim. An SQL draft, a textual review, or local fixture proof alone is not production validation. Never ask the user to paste passwords or raw confidential records.\n\n## Supporting references\n- Read `../../references/joins-and-fanout.md` when relevant.\n- Read `../../references/correctness-and-grain.md` when relevant.\n\n## Return\nA join/grain diagram in prose, safe join SQL and cardinality probes.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}