Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CREATE TABLE purchase_order (order_number int(11) NOT NULL,order_name char(50) N

ID: 3889977 • Letter: C

Question

CREATE TABLE purchase_order (order_number int(11) NOT NULL,order_name char(50) NOT NULL,customer_address char(50),customer_zip int(5) DEFAULT NULL, customer_city char(50) DEFAULT NULL,order_total varchar(50)DEFAULT NULL,V_VendorID VARCHAR(20) DEFAULT NULL,ITEM_NUMBER int(10) NOT NULL,PRIMARY KEY (order_number),FOREIGN KEY FK_vendor (V_VendorID) REFERENCES vendor(V_VendorID),FOREIGN KEY FK_inventory(ITEM_NUMBER) REFERENCES Inventory(I_FlowerNumber),CONSTRAINT FK_inventory FOREIGN KEY (ITEM_NUMBER) REFERENCES Inventory (I_FlowerNumber),CONSTRAINT FK_vendor FOREIGN KEY (V_VendorID) REFERENCES Vendor (V_VendorID));

I cant get this code to work? I am getting the error message ORA-00907: missing right parenthesis

Explanation / Answer

I checked this query in my PC by dividing in parts. They were no errors in the part which does not contain the Foreign key part. But when I am including the foreign key part it was raising errors. So the errors are in the foreign key part.Considering the foreign key part which is this.

FOREIGN KEY FK_vendor (V_VendorID) REFERENCES vendor(V_VendorID),
FOREIGN KEY FK_inventory(ITEM_NUMBER) REFERENCES Inventory(I_FlowerNumber),


CONSTRAINT FK_inventory FOREIGN KEY (ITEM_NUMBER) REFERENCES Inventory (I_FlowerNumber),
CONSTRAINT FK_vendor FOREIGN KEY (V_VendorID) REFERENCES Vendor (V_VendorID)

Here I found that the both the pairs are same and so removing first two bold lines will solve the problem. Try it and comment again to know the output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote