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

Creating Tables in a new Database

User, date Message
Written by Hugoriffic
3 years ago
Category: General
1 posts since Thu, 03 Nov 11
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?
Written by ansgar
3 years ago
5045 posts since Fri, 07 Apr 06
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)
);

Written by muzza4
3 years ago
51 posts since Mon, 04 Dec 06
Char_Name char(50) Not null,

should read

Char_Name char(50) Not null
 

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