|
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?
week6-fullstack-king/database/schema.sql
Lines 3 to 11 in 9651760
week6-fullstack-king/database/schema.sql
Lines 13 to 16 in 9651760
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?