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

[Bug] Wrong value types & values in race_track, phone_market & many others #106

Open
michael-2956 opened this issue Sep 16, 2024 · 0 comments

Comments

@michael-2956
Copy link

michael-2956 commented Sep 16, 2024

race_track

The schema of race_track:

CREATE TABLE "race" (
"Race_ID" int,
"Name" text,
"Class" text,
"Date" text,
"Track_ID" text,
PRIMARY KEY ("Race_ID"),
FOREIGN KEY ("Track_ID") REFERENCES "track"("Track_ID")
);

CREATE TABLE "track" (
"Track_ID" int,
"Name" text,
"Location" text,
"Seating" real,
"Year_Opened" real,
PRIMARY KEY ("Track_ID")
);

in the line: FOREIGN KEY ("Track_ID") REFERENCES "track"("Track_ID") connects two columns of different types. This raises suspicion. It is confirmed when we look at the inserted values:

INSERT INTO  "track" VALUES (1,"Auto Club Speedway","Fontana, CA","92000","1997");
INSERT INTO  "track" VALUES (2,"Chicagoland Speedway","Joliet, IL","75000","2001");
INSERT INTO  "track" VALUES (3,"Darlington Raceway","Darlington, SC","63000","1950");
...

Track_ID is absent, and there's an extra postal code there.

phone_market

In the phone_market schema:

CREATE TABLE "phone" (
"Name" text,
"Phone_ID" int,
"Memory_in_G" int,
"Carrier" text,
"Price" real,
PRIMARY KEY ("Phone_ID")
);

...

CREATE TABLE "phone_market" (
"Market_ID" int,
"Phone_ID" text,
"Num_of_stock" int,
PRIMARY KEY ("Market_ID","Phone_ID"),
FOREIGN KEY ("Market_ID") REFERENCES `market`("Market_ID"),
FOREIGN KEY ("Phone_ID") REFERENCES `phone`("Phone_ID")
);

The line FOREIGN KEY ("Phone_ID") REFERENCES `phone`("Phone_ID") tries to connect text and integer.

The data, however, seems to correctly insert integer instead of text

INSERT INTO  "phone_market" VALUES (1,1,2232);
INSERT INTO  "phone_market" VALUES (2,2,4324);
INSERT INTO  "phone_market" VALUES (1,4,874);

...

Other shcemas

Such issues are also present in the following other schemas: academic,student_assesment,city_record,shop_membership,concert_singer,museum_visit,architecture,party_people,performance_attendance, culture_company,employee_hire_evaluation, aircraft, school_finance, loan_1, cre_Drama_Workshop_Groups,car_1, phone_1, wrestler.

@michael-2956 michael-2956 changed the title Wrong value types & values in race_track [Bug] Wrong value types & values in race_track Sep 16, 2024
@michael-2956 michael-2956 changed the title [Bug] Wrong value types & values in race_track [Bug] Wrong value types & values in race_track & phone_market Sep 16, 2024
@michael-2956 michael-2956 changed the title [Bug] Wrong value types & values in race_track & phone_market [Bug] Wrong value types & values in race_track, phone_market & many others Sep 17, 2024
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