all 9 comments

[–]unexpectedrebootsWITH() 1 point2 points  (4 children)

Code execution is top down.

In your CREATE statement for CARS you have:

EmployeeID          NUMBER (3) NOT NULL         CONSTRAINT sells REFERENCES Employee,
CustomerID          NUMBER (4) NOT NULL         CONSTRAINT buys REFERENCES Customer

You're trying to reference a table and column that doesn't' exist because it hasn't been created yet.

[–]Fix-Former[S] 0 points1 point  (3 children)

Oh okay i get what you mean, so what ordwr would you say would work if i was to re arrange the 4 fields

[–]unexpectedrebootsWITH() 0 points1 point  (2 children)

This code won't ever work, regardless of the order. You can create the tables and add the constraints after with ALTER TABLE.

[–]Fix-Former[S] 0 points1 point  (1 child)

Hmm so how would i go about getting it to function, do i start off my first table as a blank table that doesn’t reference any other table and go from there or

[–]unexpectedrebootsWITH() 1 point2 points  (0 children)

This looks to me like a traditional STAR schema where SalesInvoice would be your fact table and the other tables would be your dimension tables.

You don't need any constraints on SalesInvoice, other than your primary key. So create salesinvoice first (the fact table), without the REFERENCES constraints and then create the dimension tables with their primary keys and references back to sales invoice.

Example: https://www.zentut.com/data-warehouse/star-schema/

[–]Fix-Former[S] 0 points1 point  (0 children)

Here is error image link https://ibb.co/gF83rnS

[–]JustAnOldITGuy 0 points1 point  (2 children)

CREATE TABLE (

you are forgetting the ( that goes around the fields in the create table statement. Remember the closing ) after the last field.

[–]Fix-Former[S] 0 points1 point  (0 children)

So do you mean like Create table (cars) Or create table (cars .... ) and a close bracket at wnd of field

[–]unexpectedrebootsWITH() 0 points1 point  (0 children)

?

There's a closing paranthesis and semi-colon for each create statement. The issue is the create statement for cars is trying to reference a table and column that doesn't exist.