Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 What's wrong with this create table statement?

Author  Topic 

snowy
Starting Member

5 Posts

Posted - 2009-09-28 : 04:23:42
hey i'm workin with creating tables in sql and
i'm not sure where i'm syntactically incorrect,
yeh i'm pretty noob at this :(

SQL> CREATE TABLE Course_Enrollment
2 (
3 Student_ID char(8) NOT NULL,
4 Course_ID char(10) NOT NULL,
5 Year_enrolled char(4) NOT NULL,
6 Semester Integer NOT NULL,
7 Grade Integer DEFAULT NULL,
8 PRIMARY KEY(Student_ID,Course_ID, Year_enrolled, Semester),
9 FOREIGN KEY(Student_ID) REFERENCES Student(Student_ID) ON UPDATE CASCADE
10 FOREIGN KEY(Course_ID) REFERENCES Course(Course_ID) ON UPDATE CASCADE
11 CONSTRAINT GradeCheck CHECK (Grade IN (1,2,3,4,5,6,7))
12 );
FOREIGN KEY(Student_ID) REFERENCES Student(Student_ID) ON UPDATE CASCADE
*
ERROR at line 9:
ORA-00905: missing keyword


Thanx

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-09-28 : 05:39:09
This is a Microsoft SQL Server forum.
Please try over at www.dbforums.com in their ORACLE forum.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -