SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table componentes ( nomear varchar(2) not null primary key, quant int, descript varchar(50) ); insert into componentes(nomear, quant, descript) values ('U1', 1, 'Arduino Uno R3'), ('R1', 1, '220 Ω Resistor'), ('D1', 1, 'Vermelho LED'); select * from componentes; create view Descricoes as select descript as Itens from componentes; select * from Descricoes; alter table componentes add column valor float after descript; update componentes set valor = 20 where nomear = 'U1'; update componentes set valor = 10.50 where nomear = 'R1'; update componentes set valor = 500.10 where nomear = 'D1'; select * from componentes; create view Results as select descript as Itens, cast((quant*valor) as int) as Custo from componentes; select * from Results;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear