@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix edu: <https://knobit.org/def/> .
@prefix knobit: <https://knobit.org/id/knobit/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix register: <https://knobit.org/id/register/> .
@prefix schema: <https://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

knobit:K-814 a edu:Knobit ;
    rdfs:label "Recognises a foreign-key cycle taken as resolved"@en ;
    dcterms:identifier "K-814" ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source "Review checklist 05-ddl, row 14; ISO 9075; this skill (08-ddl.md)"@en ;
    skos:altLabel "Foreign-key cycle fallback treated as resolved (generated DDL)"@en ;
    skos:definition "The header note saying all tables are created first and every foreign key added afterwards as `ALTER TABLE`. The script runs; the design does not. Two tables each mandatory to the other cannot be loaded without deferring a constraint, and not every engine can defer one."@en ;
    skos:prefLabel "Recognises a foreign-key cycle taken as resolved"@en ;
    edu:actionVerb "Recognises"@en ;
    edu:appliesKnowledge knobit:K-653 ;
    edu:assessmentCriterion "Flags the deficient case and passes the acceptable one. Deficient: `dim_account.primary_card_key` → `dim_card` and `dim_card.account_key` → `dim_account`, both `NOT NULL`; the DDL deploys and the first load has no row it can insert first Acceptable: One direction made optional, or the \"primary card\" relationship moved into its own table. The cycle is resolved in the logical model, not worked around in the load (the header note is a prompt, not a solution)"@en ;
    edu:assessmentMethod "skill-tests task: Generated DDL review, Postgres and Snowflake (DDL review skills)"@en ;
    edu:contextFunction <https://knobit.org/def/contextFunction/resultEvaluation> ;
    edu:creationMethod <https://knobit.org/def/creationMethod/aiGeneratedHumanEdited> ;
    edu:expectedResult "The cycle and the load order or deferral it needs"@en ;
    edu:graphRelevance <https://knobit.org/def/graphRelevance/learnerState>,
        <https://knobit.org/def/graphRelevance/taskSelection> ;
    edu:knobitType <https://knobit.org/def/knobitType/skill> ;
    edu:targetObject "foreign keys added after table creation"@en ;
    schema:creativeWorkStatus "accepted" ;
    schema:isPartOf register:data-modelling .

edu:Knobit rdfs:label "Knobit"@en,
        "Knobit"@et .

knobit:K-653 rdfs:label "Explains referential integrity and referential actions"@en .

