create or replace view go13.kelkin_feladat1 as 
select synonym_category_id, count(term_id) syn  from go13.term_synonym
group by synonym_category_id;

create or replace view go13.kelkin_feladat2 as
select t1.name, length(t1.name) leng
from go13.term t1;

create or replace view go13.kelkin_feladat3 as
select t1.name, avg(t2.term_id) over() avarage
from go13.term_synonym t2 left outer join go13.term t1
on t1.id=t2.term_id;

create or replace view go13.kelkin_feladat4 as
select id,name, parts,
rank() over (order by parts desc) ranks
from ( select id, name, count(subset_id) over( partition by name) parts
from go13.term g2 left outer join go13.term_subset g1
on g2.id=g1.term_id);

create or replace view go13.kelkin_feladat5 as ;
select synonym_type_id,
listagg( synonym_category_id, ',') within group (order by term_id) typess,
count(term_id) numbers
from go13.term_synonym
group by synonym_type_id;
