[請問] sql程式有錯嗎

看板Database作者 (炸彈摔5566)時間14年前 (2011/10/10 15:27), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
※ [本文轉錄自 ask 看板 #1EafkLe4 ] 作者: batista5566 (炸彈摔5566) 看板: ask 標題: [請問] sql程式有錯嗎 時間: Mon Oct 10 15:15:30 2011 phpMyAdmin - 2.10.3 MySQL 客戶端版本: 5.0.22 己使用 PHP 擴充附件: mysql 我剛剛打了這一串程式碼 到student那就錯了,但我不知道是哪裡有問題, 重打也一樣, create table COURSE ( Course_name varchar(30), Course_number varchar(15), Credit_hours int, Department char(10) not null, primary key(Course_number,Department) )type=innodb; create table STUDENT ( Name varchar(10), Student_number int not null, Class int, Major char(10) not null, primary key(Student_number,Major), foreign key (Major) references COURSE(Department) on delete cascade on update cascade )type=innodb; 請sql高手來解答好嗎? 如果COURSE那邊的pk只設一個就會成功,但是我有兩個要設。 該怎麼辦? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.124.43.37 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.124.43.37 ※ 編輯: batista5566 來自: 140.124.43.37 (10/10 15:35) ※ 編輯: batista5566 來自: 140.124.43.37 (10/10 16:53)

10/10 17:17, , 1F
我再問版回你了-b-
10/10 17:17, 1F
文章代碼(AID): #1EafvSSG (Database)