Creating Tables in a new Database

[expired user #6019]'s profile image [expired user #6019] posted 12 years ago in General Permalink
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's profile image ansgar posted 12 years ago Permalink
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's profile image muzza4 posted 12 years ago Permalink
Char_Name char(50) Not null,

should read

Char_Name char(50) Not null

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