Hello I need some help on the following 3 part question I have included the table structure below, none of the tables have key constraints. Any help or suggestions would be appreciated. - Thanks for your time.
1.) Create a view called PURITAINCHILDREN view to see the name, age and school year of all children of employees insured by Puritain.
I have tried the following code which I hear is somewhat near the correct code to no avail.
SQL> CREATE VIEW view_puritainchildren (cname, childage, schyear)
2 AS SELECT DISTINCT cname,childage,schyear from child
3 FROM child, insur_co
4 WHERE insur_co.empno = child.empno
5 AND insur_co.empno = 'PURITAIN');
FROM child, insur_co
*
ERROR at line 3:
ORA-00933: SQL command not properly ended
2.) Using the PURITAINCHILDREN view, obtain a list of children whose age is less than or equal to 20 excluding the child whose age is less than 10. Show the name, age, and school year of each child.
3.) Using the PURITAIN CHILDREN view, crate a new view called LITTLEPURITAINCHILDREN consisting of name, age and school year of children whose age is less than 10.
SQL> DESC doctor;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
DNAME VARCHAR2(20)
SPECIALTY VARCHAR2(20)
YRSEXPER NUMBER(2)
SQL> DESC clinic;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
DNAME VARCHAR2(20)
CNAME VARCHAR2(20)
ADDRESS VARCHAR2(30)
SQL> DESC employee;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
DNAME VARCHAR2(20)
EMPNO NUMBER(3)
ENAME VARCHAR2(20)
ADDRESS VARCHAR2(30)
AMTOWED NUMBER(5)
SQL> DESC insurco;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
DNAME VARCHAR2(20)
EMPNO NUMBER(3)
INAME VARCHAR2(20)
ADDRESS VARCHAR2(30)
CYCLE NUMBER(3)
SQL> DESC child;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
DNAME VARCHAR2(20)
EMPNO NUMBER(3)
CNAME VARCHAR2(20)
CHILDAGE NUMBER(2)
SCHYEAR VARCHAR2(2)