1CREATE TABLE table_name(
2 id INT AUTO_INCREMENT PRIMARY KEY,
3 name VARCHAR(255), # String 255 chars max
4 date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
5 longtext BLOB
6);
1CREATE TABLE recipe_ingredients (
2 recipe_id int NOT NULL,
3 ingredient_id INT NOT NULL,
4 amount INT NOT NULL,
5 PRIMARY KEY (recipe_id,ingredient_id)
6);
7
8INSERT INTO recipe_ingredients
9 (recipe_id, ingredient_id, amount)
10VALUES
11 (1,1,1),
12 (1,2,2),
13 (1,3,2),
14 (1,4,3),
15 (1,5,1),
16 (2,3,2),
17 (2,6,1),
18 (3,5,1),
19 (3,7,2);
20
1CREATE TABLE table_name (
2 column1 datatype,
3 column2 datatype,
4 column3 datatype,
5 ....
6);