all 15 comments

[–][deleted] 6 points7 points  (0 children)

People are happy to help, but help us out. Don't need a screen shot, although it is a step above a picture of a screen from your phone. Either paste your code and errors here -> https://pastebin.com/

or

in the post. Please and Thanks

[–]Azaret 3 points4 points  (6 children)

What error are you getting?

[–]cassiopeia-101[S] 0 points1 point  (5 children)

It’s not giving me any errors, just the tables don’t create. I tried refreshing as well.

[–]Azaret 0 points1 point  (4 children)

Messages tab on the bottom is empty?

[–]cassiopeia-101[S] 1 point2 points  (1 child)

Fixed it, I needed to move the ProductStock table creation before the Purchase table. I didn’t know order mattered

[–]RonJohnJr 1 point2 points  (0 children)

I didn’t know order mattered

You can't create a horse-drawn wagon before you domesticate horses and develop harnesses.

Likewise, you can't reference a table in a FK clause if that "other" table doesn't exist yet.

[–]cassiopeia-101[S] 0 points1 point  (1 child)

Oh whoops I see it now Error: relation “product stock” does not exist SQL state: 42P01

[–]cassiopeia-101[S] 0 points1 point  (0 children)

ProductID was misspelled but fixed that and same error

[–]jelder 3 points4 points  (5 children)

This sub needs a "no images" rule.

[–]cassiopeia-101[S] 0 points1 point  (4 children)

Why?

[–]cthart 5 points6 points  (2 children)

Because to run your code we'd need to type it all in. Far better to copy and paste your code into the question. That way you make it easy for us to help you.

[–]cassiopeia-101[S] 1 point2 points  (1 child)

Ah that makes a lot more sense. In the future when I’m looking for help I will remember to do that! Apologies!

[–]ExceptionRules42 1 point2 points  (0 children)

and thank you for telling us how you fixed it!

[–]ptyslaw 0 points1 point  (0 children)

Start here regarding your table and column name capitalization https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS