CREATE TABLE students (
Year NUMBER(4) NOT NULL,
Semester VARCHAR2(1) NOT NULL CONSTRAINT stu_sem_ck CHECK (semester IN ('1', '2', '3')),
department VARCHAR2(3) NOT NULL,
course_number NUMBER NOT NULL,
session VARCHAR2(3),
first_name NVARCHAR2(10),
Middle_name NVARCHAR2(15),
last_name NVARCHAR2(15) NOT NULL,
id NUMBER(9) NOT NULL,
area_code VARCHAR2(3),
phone_number VARCHAR2(7),
email_address NVARCHAR2(60),
Street1 NVARCHAR2(20),
street2 NVARCHAR2(20),
city NVARCHAR2(20),
State_prov NVARCHAR2(20),
country CHAR(2),
postal_code NVARCHAR2(15),
language CHAR(2),
CONSTRAINT student_pk PRIMARY KEY (id))
在 SQL devloper 上运行时,它给了我以下错误
Error starting at line 2 in command:
CREATE TABLE students (
Year NUMBER(4) NOT NULL,
Semester VARCHAR2(1) NOT NULL CONSTRAINT stu_sem_ck CHECK (semester IN ('1', '2', '3')),
department VARCHAR2(3) NOT NULL,
course_number NUMBER NOT NULL,
session VARCHAR2(3),
first_name NVARCHAR2(10),
Middle_name NVARCHAR2(15),
last_name NVARCHAR2(15) NOT NULL,
id NUMBER(9) NOT NULL,
area_code VARCHAR2(3),
phone_number VARCHAR2(7),
email_address NVARCHAR2(60),
Street1 NVARCHAR2(20),
street2 NVARCHAR2(20),
city NVARCHAR2(20),
State_prov NVARCHAR2(20),
country CHAR(2),
postal_code NVARCHAR2(15),
language CHAR(2),
CONSTRAINT student_pk PRIMARY KEY (id))
Error at Command Line:6 Column:1
Error report:
SQL Error: ORA-00904: : invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error starting at line 1 in command:
CREATE TABLE students (