add dsvgo querries

This commit is contained in:
Johannes Jöns 2024-02-09 07:00:17 +01:00
parent f74bf93786
commit ae1ccbd629

View file

@ -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';
# get Ingredients where carbohydrates are lower than 40
@ -19,8 +19,6 @@ FROM SupplierContainsIngredients
GROUP BY supplier;
# Stock low warning
DEFINE EVENT ingredient_stock_low ON TABLE Ingredient
WHEN $after.stock < 10 THEN (
@ -28,3 +26,14 @@ WHEN $after.stock < 10 THEN (
ingredient_id = $value.id,
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;