I have looked up how to create tables of M:N Relations.
Here is my SQL Code:
CREATE TABLE "product"(
"ProductID" INT PRIMARY KEY,
"ProductName" VARCHAR(25) NOT NULL,
"Price" NUMBER NOT NULL,
"Description" VARCHAR(25),
"Quantity" INT NOT NULL
);
CREATE TABLE "transaction"(
"TransactionID" INT PRIMARY KEY,
"Date" INT NOT NULL
);
CREATE TABLE "trade"(
"ProdID" INT REFERENCES "product"("ProductID"),
"TransID" INT REFERENCES "transaction"("TransactionID"),
"QuantityPurchased" INT NOT NULL,
PRIMARY KEY (TransID, ProdID)
);
When I run this I get:
Error report -
ORA-00904: "TRANSID": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Is there anything wrong with my code?