Skip to content

Are two tables really necessary here? #53

@yassienAbdillahi

Description

@yassienAbdillahi

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?

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