distal-attribute
distal-attribute
distal-attribute
distal-attribute

Creating Tables in a new Database

Hugoriffic posted 3 years ago in General
CREATE TABLE Character
(
Movie_ID char(50) Primary Key Not null,
Actor_ID char(50) Primary Key Not null,
Char_Name char(50) Not null,
);

With this I get a syntax error. Can anyone explain why?
ansgar posted 3 years ago
You should also post the syntax error message here, so we don't have to guess...

But it's obvious that you have the "primary key" stuff at the wrong place. Should look like this (untested):

CREATE TABLE Character
(
Movie_ID char(50) Not null,
Actor_ID char(50) Not null,
Char_Name char(50) Not null,
PRIMARY KEY (Movie_ID, Actor_ID)
);

muzza4 posted 3 years ago
Char_Name char(50) Not null,

should read

Char_Name char(50) Not null

Please login to leave a reply, or register at first.