SQL homework done 1st lesson
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user