From 69e227b59fab5fc17491c61d6aeaa365cad156d1 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 Jan 2026 06:03:41 +0300 Subject: [PATCH] SQL homework done 1st lesson --- aharlamcev/postgresql/sqlhomework.sql | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 aharlamcev/postgresql/sqlhomework.sql diff --git a/aharlamcev/postgresql/sqlhomework.sql b/aharlamcev/postgresql/sqlhomework.sql new file mode 100644 index 0000000..4fb1078 --- /dev/null +++ b/aharlamcev/postgresql/sqlhomework.sql @@ -0,0 +1,23 @@ +create table products_extended ( +id INT primary key, +name VARCHAR(100) not null, +category VARCHAR(50), +price DECIMAL(10, 2), +in_stock BOOLEAN default true, +email_support VARCHAR(50) +); + +insert into products_extended (id, name, category, price, in_stock, email_support) +values (1, 'Mi Band 7', 'smartwatch', 49, true, 'miband@xiaomi.com'); + +insert into products_extended (id, name, category, price, in_stock, email_support) +values (2, 'Surface Pro', 'tablet', 1299, true, 'surface@microsoft.com'); + +select * from products_extended -- проверил как выглядит таблица + +alter table products_extended +add column rating DECIMAL(5, 2); + +truncate table products_extended; + +drop table products_extended