I am trying to create a table in SQL. It’s a pretty straightforward table, and I could use Design View, but I’m trying to learn more about SQL. When I try, I get “unexpected token in statement” error. I’m sure this is a typo, a syntax error or both, but can’t figure out exactly WHAT I have done wrong. Here’s the code I’m trying to execute:
CREATE TABLE “Movies”(
“Movie-ID”
INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0)
NOT NULL
PRIMARY KEY
,"TITLE"
VARCHAR (255)
NOT NULL
,"YEAR"
SMALLINT (5)
, "YEAR WATCHED"
SMALLINT (5)
, "SCORE"
DECIMAL (4,2)
,"Country"
Integer REFERENCES
"Countries" ("Country-ID")
,"LANGUAGE"
VARCHAR (255)
)
;
The table and column names referenced in the FK are both correct, fwiw.
Where have I gone wrong here?