Skip to content

Dangling SSNs in PERSON not referencing INCOME #39

@ReneNyffenegger

Description

@ReneNyffenegger

Although SSN in PERSON is declared as foreign key to INCOME, there are some records in PERSON whose SSNs don't reference the primary key in INCOME. This is possible because SQLite does not enforce foreign keys by default.

sqlite> select count(*) from person where ssn not in (select ssn from income);
2497

This caused quite a bit of mystery when I tried to port the game to another database.

Similarly, there are 5 persons whose LICENSE_ID is not found in DRIVERS_LICENSE:

select * from person where license_id not in (select id from drivers_license);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions