【发布时间】:2018-04-08 08:32:55
【问题描述】:
CREATE TABLE Appointment
(
appointID INTEGER,
appoint_date DATE,
appoint_time TIME,
appoint_type VARCHAR(5),
primary key (appointID)
);
INSERT INTO Appointment VALUES(1, '15-Apr-2017', '10:00', 'long');
INSERT INTO Appointment VALUES(2, '15-Apr-2017', '10:30', 'short');
INSERT INTO Appointment VALUES(3, '28-May-2017', '14:00', 'long');
INSERT INTO Appointment VALUES(4, '20-May-2017', '15:00', 'short');
INSERT INTO Appointment VALUES(5, '11-May-2017', '10:30', 'long');
INSERT INTO Appointment VALUES(6, '26-Jun-2017', '9:30', 'short');
INSERT INTO Appointment VALUES(7, '30-Jun-2017', '14:00', 'long');
INSERT INTO Appointment VALUES(8, '30-Jun-2017', '15:30', 'short');
INSERT INTO Appointment VALUES(9, '28-Apr-2017', '16:00', 'short');
INSERT INTO Appointment VALUES(10,'30-Apr-2017', '13:00', 'short');
当我尝试添加 TIME 时,我不断收到此错误:
Error starting at line : 24 in command -
CREATE TABLE Appointment(
appointID INTEGER,
appoint_date DATE,
appoint_time TIME,
appoint_type VARCHAR(5),
primary key (appointID)
)
Error report -
ORA-00902: invalid datatype
00902. 00000 - "invalid datatype"
*Cause:
*Action:
我也在尝试添加我的 DOCTOR TABLE,但我不断收到错误报告
ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
*Cause:
*Action:**
create table Doctor
(
appointID INTEGER not null,
regnum CHAR(6),
doc_name VARCHAR(40),
doc_gender CHAR(1),
qual VARCHAR(80),
foreign key (appointID) references Appointment
primary key (appointID, regnum)
);
【问题讨论】: