create table EMPLOYEE
(Emp_id VARCHAR(30) not null,
Emp_fname varchar(20),
Emp_mname varchar(20),
Emp_lname varchar(20),
Emp_SSN varchar(20),
"position" varchar(30),
Emp_Straddr1 varchar(100),
Emp_Straddr2 varchar(100),
Emp_City varchar(100),
Emp_State varchar(100),
Emp_Zip char(5),
Emp_Phone varchar(20),
Supervisor VARCHAR(30) not null,
constraint pk_employee primary key (Emp_id),
constraint fk_employeehassupervisor foreign key (Supervisor) references EMPLOYEE(Emp_id));
create table VINEYARD
(Vineyard_Name VARCHAR(20) not null,
"Location" varchar(30),
"Size" number(4,2),
Emp_id VARCHAR(5) not null,
constraint pk_vineyard primary key (Vineyard_Name),
constraint fk_vineyardhasmanager foreign key (Emp_id) references EMPLOYEE(Emp_id));
create table GRAPE
(Grape_Name varchar(30) not null,
JuiceConversionRatio number(5,2),
WineStorageRequirement varchar(30),
WineAgingRequirement varchar(1),
constraint pk_grape primary key (Grape_Name));
alter table VINEYARD
modify (Vineyard_Name VARCHAR(20));
create table GRAPE_HARVEST_HISTORY
(Vineyard_Name varchar(20) not null,
Grape_Name varchar(30) not null,
"Year" YEAR NOT NULL,
Weight number(4,2),
RipenessDegree number(5,2),
constraint pk_grape_harvest_history primary key (Vineyard_Name,"Year"),
constraint fk_grape_harvest_historyhasvineyard foreign key (Vineyard_Name) references VINEYARD(Vineyard_Name),
constraint fk_grape_harvest_historyhasgrape foreign key (Grape_Name) references GRAPE(Grape_Name));
down here is what exactly shown in ORACLE SQL.
Table EMPLOYEE created.
Table VINEYARD created.
Table GRAPE created.
Table VINEYARD altered.
Error starting at line : 38 in command - create table GRAPE_HARVEST_HISTORY (Vineyard_Name varchar(20) not null, Grape_Name varchar(30) not null, "Year" YEAR NOT NULL, Weight number(4,2), RipenessDegree number(5,2), constraint pk_grape_harvest_history primary key (Vineyard_Name,"Year"), constraint fk_grape_harvest_historyhasvineyard foreign key (Vineyard_Name) references VINEYARD(Vineyard_Name), constraint fk_grape_harvest_historyhasgrape foreign key (Grape_Name) references GRAPE(Grape_Name)) Error report - SQL Error: ORA-00972: identifier is too long 00972. 00000 - "identifier is too long" *Cause: An identifier with more than 30 characters was specified. *Action: Specify at most 30 characters.