24 lines
718 B
SQL
24 lines
718 B
SQL
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
|