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

Are two tables really necessary here? #53

Open
yassienAbdillahi opened this issue Feb 23, 2023 · 0 comments
Open

Are two tables really necessary here? #53

yassienAbdillahi opened this issue Feb 23, 2023 · 0 comments

Comments

@yassienAbdillahi
Copy link

CREATE TABLE IF NOT EXISTS fruits (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
image_path TEXT ,
price DECIMAL,
fruit_description TEXT,
fruit_type INTEGER REFERENCES fruit_types(id)
);

CREATE TABLE IF NOT EXISTS fruit_types(
id TEXT PRIMARY KEY,
name TEXT
);

Maybe it's just me but I'm failing to see why you actually need a second table given that fruit type is already a column of the first table?

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