CREATE TABLE Masina(
idMasina INT PRIMARY KEY NOT NULL,
marca VARCHAR(20),
model VARCHAR(20),
pretFaraDotari DOUBLE
);
CREATE TABLE Dotari(
idDotare INT PRIMARY KEY NOT NULL,
dotare VARCHAR(30),
pret INT
);
CREATE TABLE Comenzi(
idComanda INT PRIMARY KEY NOT NULL,
idMasina INT,
pretTotal DOUBLE,
discount VARCHAR(10),
FOREIGN KEY (idMasina)
REFERENCES Masina(idMasina) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE Com_Dot(
idComanda INT,
idDotare INT,
FOREIGN KEY (idComanda)
REFERENCES Comenzi(idComanda) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (idDotare)
REFERENCES Dotari(idDotare) ON DELETE CASCADE ON UPDATE CASCADE
);
How can i display "marca", "model", "pretFaraDotari" from "Masina" table, the total price of "dotare" for each car from "Dotari" table, "pretFaraDotari" + total price of dotare, and "pretTotal" from the "Comenzi" table for all entries in the table "Comenzi"?
I need all of this displayed using just one command.. that's the big problem