add dsvgo querries
This commit is contained in:
parent
f74bf93786
commit
ae1ccbd629
1 changed files with 12 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Find ingridents included in recipe
|
# Find ingredients included in recipe
|
||||||
SELECT ingredient.designation AS Ingredient FROM RecipeContainsIngredients WHERE recipe.name = 'Tomato Basil Salad';
|
SELECT ingredient.designation AS Ingredient FROM RecipeContainsIngredients WHERE recipe.name = 'Tomato Basil Salad';
|
||||||
|
|
||||||
# get Ingredients where carbohydrates are lower than 40
|
# get Ingredients where carbohydrates are lower than 40
|
||||||
|
@ -19,8 +19,6 @@ FROM SupplierContainsIngredients
|
||||||
GROUP BY supplier;
|
GROUP BY supplier;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Stock low warning
|
# Stock low warning
|
||||||
DEFINE EVENT ingredient_stock_low ON TABLE Ingredient
|
DEFINE EVENT ingredient_stock_low ON TABLE Ingredient
|
||||||
WHEN $after.stock < 10 THEN (
|
WHEN $after.stock < 10 THEN (
|
||||||
|
@ -28,3 +26,14 @@ WHEN $after.stock < 10 THEN (
|
||||||
ingredient_id = $value.id,
|
ingredient_id = $value.id,
|
||||||
created_at = time::now()
|
created_at = time::now()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# User Data Exporting
|
||||||
|
LET $customer = 'd.foede@web.de';
|
||||||
|
SELECT *, address.*, (SELECT * FROM Order WHERE customer.email = $customer) AS orders FROM Customer WHERE email = $customer;
|
||||||
|
|
||||||
|
# Delete User Data
|
||||||
|
LET $customer = SELECT id FROM Customer WHERE email = 'd.foede@web.de';
|
||||||
|
DELETE $customer.address;
|
||||||
|
DELETE OrderContainsIngredients WHERE order.customer = $customer;
|
||||||
|
DELETE Order WHERE customer = $customer;
|
||||||
|
DELETE $customer;
|
Loading…
Reference in a new issue