SQL homework done 1st lesson

This commit is contained in:
Alex
2026-01-15 06:03:41 +03:00
parent 08e09f7515
commit 69e227b59f
+23
View File
@@ -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