Create Table Items
(i_num Integer Not Null Primary Key,
i_title Varchar (50) Not Null,
d_num Integer Not Null,
i_price Decimal (6,2) Not Null,
i_release_date Date Not Null,
i_genre Varchar (15) Not Null Check
(i_genre IN ('Jazz', 'Blues', 'Country', 'Rock', 'Alternative', 'Rap', 'Classical', 'Other')),
Foreign Key (d_num) References Distributors (d_num),
On Update Cascade
On Delete Cascade);
0
A
回答
0
Create Table Distributors (
d_num Integer Not null
);
Create Table Items(
i_num Integer Not Null Primary Key,
i_title Varchar(50) Not Null,
d_num Integer Not Null,
i_price Decimal(6,2) Not Null,
i_release_date Date Not Null,
i_genre Varchar(15) Not Null,
constraint FOREIGN KEY (d_num) REFERENCES Distributors(d_num) ON UPDATE CASCADE ON DELETE CASCADE,
Constraint ´genre_items_in´ Check (i_genre IN ('Jazz', 'Blues', 'Country', 'Rock', 'Alternative', 'Rap', 'Classical', 'Other'))
);
查明錯誤試試這個,當定義級聯你在利用unncessary「」在你的命令符號。
+0
謝謝,那也沒用。 –
+0
您能否給我提供錯誤的詳細信息。 –
+0
你的SQL語法有錯誤;檢查與您的MySQL服務器版本相對應的手冊,在' Constraint'genre_items_in'檢查(i_genre IN('Jazz','Blues','Country',''at line 8 –
相關問題
- 1. 爲什麼我的C#代碼導致堆棧溢出
- 2. 爲什麼我的遞歸代碼導致堆棧溢出錯誤?
- 3. 代碼中的堆棧溢出錯誤
- 4. 爲什麼我在下面的代碼中得到堆棧溢出?
- 5. 我跑到我的代碼的輸出溢出錯誤
- 6. 爲什麼我收到堆棧溢出錯誤?
- 7. 爲什麼我不能檢查我的堆棧上有什麼?
- 8. 代碼產生錯誤1064(42000),我不知道爲什麼
- 9. 爲什麼我的代碼會出現此錯誤?
- 10. 我的溢出代碼不起作用
- 11. 堆棧溢出的示例代碼
- 12. 爲什麼堆棧在這段代碼中溢出?
- 13. 爲什麼這個C++代碼觸發堆棧溢出?
- 14. 這段代碼爲什麼會導致堆棧溢出?
- 15. 爲什麼我在使用我的代碼時出現#VALUE錯誤?看看我的代碼
- 16. 請檢查代碼並告訴我爲什麼會出現此錯誤?
- 17. 爲什麼我在這段代碼中出現語法錯誤?
- 18. 爲什麼我在此代碼中出現分段錯誤
- 19. 爲什麼我在C代碼中出現分段錯誤?
- 20. 是我的代碼堆棧?
- 21. 我在代碼中出現溢出錯誤,但我似乎無法修復它,有什麼建議嗎?
- 22. 循環代碼導致堆棧溢出
- 23. 當我打開Delphi XE IDE時出現堆棧溢出錯誤
- 24. 我找不出爲什麼我的代碼不起作用?
- 25. 爲什麼我的代碼拋出NumberFormatException?
- 26. 爲什麼我的代碼拋出ClassNotFoundException?
- 27. 爲什麼我的代碼拋出IllegalMonitorStateException?
- 28. 爲什麼我在我的java代碼中出現這個錯誤?
- 29. 爲什麼我在我的Android代碼中出現空指針錯誤?
- 30. 爲什麼堆棧溢出?
你的問題是什麼? –
問題是爲什麼我得到我的代碼錯誤。 –
請顯示實際的錯誤信息,而不僅僅是錯誤號。 –