I am trying to create two tables, which is throwing ORA-00902 error, can't figure out what's wrong here...
CREATE TABLE VEHICLE_STORE
(
MODEL_NO VARCHAR2(12) NOT NULL,
DESCRIPTION VARCHAR2(1000) NOT NULL,
UNIT_PRICE NUMBER(10) NOT NULL,
CURRENT_STOCK NUMBER(5) NOT NULL,
CC NUMBER(3) NOT NULL,
CONSTRAINT vehicle_store_pk PRIMARY KEY(MODEL_NO)
);
CREATE TABLE VEHICLE_BOOKING
(
BOOKING_ID VARCHAR2(12) NOT NULL,
CUSTOMER_NAME VARCHAR2(30) NOT NULL,
EMAIL_ID VARCHAR2(30) NOT NULL,
CONTACT NUMBER(15) NOT NULL,
ADDRESS VARCHAR2(500) NOT NULL,
PINCODE NUMBER(10) NOT NULL,
MODEL_NO VARCHAR2(12) NOT NULL,
DATE_OF_BOOKING VARCHAR2(12) NOT NULL,
EXPECTED_DATE_OF_DELIVERY VARCHAR2(12) NOT NULL,
CONSTRAINT vehicle_booking_pk PRIMARY KEY(BOOKING_ID),
CONSTRAINT vehicle_booking_fk FOREIGN_KEY(MODEL_NO) REFERENCES VEHICLE_STORE(MODEL_NO)
);
Thanks in advance...
Change FOREIGN_KEY(MODEL_NO)
to FOREIGN KEY (MODEL_NO)
(no underscore).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With