SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table Clienti ( ID_Cliente CHAR(3) PRIMARY KEY, Ragione_Sociale varchar(60), Indirizzo varchar(60), partita_iva char (11) ); create table Fatture ( Numero INT(5) PRIMARY KEY, data date, ID_Cliente CHAR(3) references Clienti(ID_Cliente), Importo float(8,2) ); insert into Clienti (ID_Cliente, Ragione_Sociale, Indirizzo, partita_iva) values ("100", "Dadi e viti S.p.A" , "Via Piave 15 - Treviso", "12345678901"); insert into Fatture (Numero, data, ID_Cliente, Importo) values ("1235", "2017-10-12", "100", "1000.00"); insert into Clienti (ID_Cliente, Ragione_Sociale, Indirizzo, partita_iva) values ("110", "Chiodi s.r.l." , "Via Po 22- Ferrara", "23456789012"); insert into Fatture (Numero, data, ID_Cliente, Importo) values ("1236", "2017-10-12", "110", "1100.00"); insert into Clienti (ID_Cliente, Ragione_Sociale, Indirizzo, partita_iva) values ("120", "Pinze e Tenaglie" , "Piazza Tevere 33 - Firenze", "34567890123"); insert into Fatture (Numero, data, ID_Cliente, Importo) values ("1237", "2017-10-13", "120", "1200.00"); alter table Fatture add column qta int; Alter table Fatture drop column qta; select * from Clienti; select * from Fatture; select * from Fatture where importo>1000; select data, importo from Fatture; select * from Fatture where importo>1000 and importo<1200; select * from Fatture where importo between 1000 and 1200; select * from Fatture where ID_Cliente = "100";
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear