FIXED
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user