I am trying to create a derived attribute (Number of seasons derived from first season). I think I need to create a view, but I am not sure.
Below is my code:
Create Table Officials(
Fname varchar2(15) not null,
Lname varchar2(15) not null,
Sport_ID number(10,2),
First_Season number(10,2),
primary key (Lname),
foreign key (Sport_ID) references Sports(Sport_ID)
);
Create View Number_of_Seasons as
Select Fs.*, extract(year from (current_date-First_Season)) as Number_of_Seasons
From Officials;
I keep getting the error:
invalid character