SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table Categoria_Prodotto ( ID_Categoria int, Nome varchar(20), Tipo varchar (20), primary key (ID_Categoria) ); create table Ordine ( ID_Ordine int, Data_Ordine date, Acquirente varchar(50), primary key (ID_Ordine) ); create table Fornitore ( ID_Fornitore int, Nome varchar(50), Sede varchar (50), primary key (ID_Fornitore) ); create table Prodotto ( ID_Prodotto int, Nome varchar (20), Prezzo int, scadenza date, ID_Categoria int, ID_Fornitore int, primary key(ID_Prodotto), foreign key (ID_Categoria) references Categoria_Prodotto (ID_Categoria), foreign key (ID_Fornitore) references Fornitore (ID_Fornitore) ); create table Carello ( ID_Carello int, Quantita bigint, ID_Ordine int, ID_Prodotto int, primary key (ID_Carello), foreign key (ID_Ordine) references Ordine (ID_Ordine), foreign key (ID_Prodotto) references Prodotto (ID_Prodotto) ); create table Categoria_Fornitore ( ID_Categoria_Fornitore int, Dal varchar(20), ID_Categoria int, ID_Fornitore int, primary key (ID_Categoria_Fornitore), foreign key (ID_Categoria) references Categoria_Prodotto (ID_Categoria), foreign key (ID_Fornitore) references Fornitore (ID_Fornitore) ); show full tables; show columns from Categoria_Prodotto; show columns from Ordine; show columns from Fornitore; show columns from Prodotto; show columns from Carello; show columns from Categoria_Fornitore;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear