From 87ba57befe7b54dae8889e7ae059c107503c7561 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 16 Feb 2026 11:05:00 +0300 Subject: [PATCH] FIXED --- aharlamcev/postgresql/SQL2.0FULL.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aharlamcev/postgresql/SQL2.0FULL.sql b/aharlamcev/postgresql/SQL2.0FULL.sql index 7cc305b..c44e8e7 100644 --- a/aharlamcev/postgresql/SQL2.0FULL.sql +++ b/aharlamcev/postgresql/SQL2.0FULL.sql @@ -23,6 +23,7 @@ id INT primary key, user_id INT, order_date DATE not null, status VARCHAR(20) +FOREIGN KEY (user_id) REFERENCES users(id) ); create table order_items ( @@ -31,6 +32,7 @@ product_id INT, quantity INT not null, price_at_purchase DECIMAL(10, 2) not null, primary key (order_id, product_id) +FOREIGN KEY () ); alter table users @@ -276,7 +278,7 @@ order by domain, name; -- 3 задание select name, age, -case when age < 25 then 'young' +case when age < 20 then 'young' when age between 20 and 30 then 'adult' else 'senior' end as age_group