Last active
February 8, 2021 13:50
-
-
Save hi-im-aj/8261c9f145eff9aafcccbf1ec58ba425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE recipeIngredientRelations( | |
id INTEGER | |
constraint table_name_pk | |
primary key autoincrement, | |
recipeId INTEGER, | |
ingredientId INTEGER, | |
unit INTEGER, | |
amount REAL | |
); | |
CREATE TABLE recipes( | |
id INTEGER | |
constraint table_name_pk | |
primary key autoincrement, | |
name TEXT NOT NULL, | |
image TEXT, | |
description TEXT | |
); | |
CREATE TABLE ingredients( | |
id INTEGER | |
constraint table_name_pk | |
primary key autoincrement, | |
name TEXT, | |
kcalPer100g REAL | |
); | |
CREATE TABLE units( | |
id INTEGER | |
constraint table_name_pk | |
primary key autoincrement, | |
name TEXT | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO recipes (name, image, description) VALUES ('Weird Mix', 'WeirdMix.png', 'Hello World!'), ('qwe', 'qwe.png', 'Hello World!2'), ('ZXC', 'ZXC.png', 'Hello World!3'); | |
INSERT INTO ingredients (name, kcalPer100g) VALUES ('Broccoli', 34), ('Egg', 108), ('Pointed cabbage', 28), ('Banana', 204), ('Apple', 34); | |
SELECT * FROM ingredients ORDER BY name; | |
update recipes set name = 'qweQwe' WHERE id = 2; | |
DELETE FROM recipes WHERE id = 2; | |
SELECT * FROM recipes ORDER BY name; | |
SELECT * FROM ingredients ORDER BY name DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment