0
나는 영화 및 위치 테이블을 만들었지 만 이상한 오류가있는 것 같습니다. 누군가 내가 잘못하고있는 것을 잡을 수 있는지 궁금합니다.Sql 오류 테이블 만들기
CREATE TABLE ShowTimes
(
showId int NOT NULL,
movieid int NOT NULL,
cinemaID int NOT NULL,
showDate date,
showTime time,
PRIMARY KEY (showId),
FOREIGN KEY ShowTimes (movieid) REFERENCES Movies (movieId),
FOREIGN KEY (cinemaID) REFERENCES Location (cinemaId)
)
오류 :
Error Code: 1005. Can't create table 'galaxy.showtimes' (errno: 150) 0.078 sec
CREATE TABLE ShowTimes
(
showId int NOT NULL,
movieid int NOT NULL,
cinemaID int NOT NULL,
showDate date,
showTime time,
PRIMARY KEY (showId),
FOREIGN KEY (movieid) REFERENCES Movies (movieId),
FOREIGN KEY (cinemaID) REFERENCES Location (cinemaId)
);
INSERT INTO ShowTimes VALUES (1, 1, 1, '2013-09-20', '17:00:00'),
(2, 1, 1, '2013-09-20', '19:00:00'),
(3, 3, 4, '2013-09-20', '17:00:00'),
(4, 2, 3, '2013-09-20', '15:15:00');
가능한 복제본 : http : //stackoverflow.com/questions/4061293/mysql-cant-create-table-errno-150 –