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