Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dangling SSNs in PERSON not referencing INCOME #39

Open
ReneNyffenegger opened this issue Jun 29, 2023 · 0 comments
Open

Dangling SSNs in PERSON not referencing INCOME #39

ReneNyffenegger opened this issue Jun 29, 2023 · 0 comments

Comments

@ReneNyffenegger
Copy link

ReneNyffenegger commented Jun 29, 2023

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant