Skip to content

Instantly share code, notes, and snippets.

@alacritythief
Created August 25, 2014 19:45
Show Gist options
  • Save alacritythief/2b40ff84851cb99ed90d to your computer and use it in GitHub Desktop.
Save alacritythief/2b40ff84851cb99ed90d to your computer and use it in GitHub Desktop.
Commands for a Recipe PostgreSQL database
CREATE TABLE recipes (id serial, name varchar(255) NOT NULL, directions TEXT);
CREATE TABLE ingredients (id serial, items TEXT);
INSERT INTO recipes (name, directions)
VALUES ('Green Eggs & Ham', '1. Cook the eggs.
2. Cook the ham.
3. Combine.');
INSERT INTO recipes (name, directions)
VALUES ('Fried Green Tomatoes', '1. Slice the tomatoes 1/2 inch thick.
2. Whisk eggs and milk together.
3. Dip tomatoes in egg mixture and then bread');
INSERT INTO recipes (name, directions)
VALUES ('Martini', '1. Pour all ingredients into mixing glass with ice cubes.
2. Stir well.
3. Strain in chilled martini cocktail glass.
4. Squeeze oil from lemon peel onto the drink, or garnish with olive.');
INSERT INTO ingredients (items)
VALUES ('4 green eggs
1/2 lb ham');
INSERT INTO ingredients (items)
VALUES ('3 large green tomatoes
2 eggs
1/2 cup milk
1/2 cup breadcrumbs
1 quart vegetable oil');
INSERT INTO ingredients (items)
VALUES ('2 oz gin
1 oz dry vermouth
(optional) lemon peel or olive');
UPDATE ingredients SET items = '3 oz vodka
1 oz dry vermouth
(optional) lemon peel or olive' WHERE id = 3;
DELETE FROM recipes WHERE id = 1;
DELETE FROM ingredients WHERE id = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment