In: Computer Science
EMP= (ename, ChildrenSet multiset(Children), SkillSet multiset(Skills))
Children = (name, birthday)
Skills = (type, ExamSet setof(Exams))
Exams = (year, city)
a)
create type Exams( year char(4), city varchar(20) )
create table exams of type Exams;- CREATE TABLE exams as Exams
create type Skills ( type varchar(20), ExamSet Exams multiset )
create table skills of type Skills :-CREATE TABLE skills as Skills
create type Birthday ( day int(2), month char(3), year int(4) )
same ->CREATE TABLE birthaday as Birthday
create type Children (name varchar(50), Birthday birthday )
same -> CREATE TABLE children as Children
create type Emp( ename varchar(50), ChildrenSet Children multiset, SkillSet Skills multiset )
create table emp of type EMP-> CREATE TABLE emp as Emp
b)
Queries in SQl
i) select ename from emp as e ,e.ChildrenSet as c ,c.birthday as b where b.year>=2000)
ii) select e.ename from emp as e ,e.SkillSt as s ,s.ExamSet as x where s.type='typing' and x.city='Dayton'
ii) select distinct s.type from emp as e ,e.SkillSet as s