I need help with this it keeps giving the same error in Oracle SQL Developer.
Error starting at line : 15 in command -
CREAT
You appear to be trying to declare a foreign key inline and have the syntax incorrect, you want:
CREATE TABLE B_BOOKING (
booking_number int PRIMARY KEY,
date_booked date,
performance_order int,
base_pay int,
band_number int,
concert_number int REFERENCES B_CONCERT(concert_number)
)
Also, you do not need a NOT NULL
constraint on a PRIMARY KEY
column.
Alternatively you can declare the constraint as:
CREATE TABLE B_BOOKING (
booking_number int PRIMARY KEY,
date_booked date,
performance_order int,
base_pay int,
band_number int,
concert_number int,
CONSTRAINT constraint_name FOREIGN KEY ( concert_number )
REFERENCES B_CONCERT(concert_number)
)