這應該是一個非常簡單的問題,但我只是看不出什麼是錯的。我試圖創建一個表,有幾個檢查,而不是空表約束,但是當我試圖執行命令時,我得到一個缺少右括號錯誤。Oracle表創建缺少右括號
CREATE TABLE students (
studentID NUMBER(5) PRIMARY KEY,
forename VARCHAR2(15) NOT NULL,
surname VARCHAR2(15) NOT NULL,
street VARCHAR2(20),
city VARCHAR2(15),
postcode VARCHAR2(10) NOT NULL,
dateOfBirth DATE() NOT NULL CHECK(dateOfBirth BETWEEN DATE '1999-01-01' AND SYSDATE),
gender VARCHAR2(10) CHECK(gender = 'male' OR gender = 'female' OR gender = 'both'),
category VARCHAR2(15) NOT NULL CHECK(category = 'first year undergraduate' OR caregory = 'postgraduate'),
fulltimeStudent VARCHAR(5) NOT NULL CHECK(fulltimeStudent = 'yes' OR fulltimeStudent = 'no'),
nationality VARCHAR(25) NOT NULL,
smoker VARCHAR(5) CHECK(smoker = 'yes' OR smoker = 'no') AND NOT NULL,
specialNeeds VARCHAR(30),
additionalComments VARCHAR(50),
status VARCHAR(15) NOT NULL CHECK(status = 'placed' or status = 'waiting')
);
'dateOfBirth DATE()'將其更改爲'DATE' –