Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SQL CANNOT USE “ INNER, LEFT, or RIGHT JOIN ” and “ ON ” syntax to perform the j

ID: 3590541 • Letter: S

Question

SQL

CANNOT USE  “INNER, LEFT, or RIGHT JOIN” and “ON” syntax to perform the join operation

18. Display all the columns in Assignment for those that have one or more rows in Hours. Your overall strategy must be a subquery connected by an “N”. 19. Display all the columns in Assignment for those that have one or more rows in Hours. Your overall strategy must be a subquery connected by an "EXISTS 03 20. Display all the columns in Assignment for those that have one or more rows in Hours. Your overall strategy must be a join Your solution can not contain any subqueries. Note that the sequence of the output rows for Query 18, 19, and 20 may be different, but the overall data values returned must be identical.

Explanation / Answer

18.

select * from Assignment where eid in(select eid from Hours);

19.

select * from Assignment a where EXISTS(select h.eid from Hours h where a.eid=h.eid);

20.

select a.eid,e.pcode,e.start.e.end,e.hours_per_week from Assignment a, Hours h where a.eid=h.eid;

13.

select id,tcode,dcode,ssn,last_name,first_name,middle_init,hire,salary,c.count(eid) from Employee e

join (select eid,count(eid) from Assignment group by eid)c on e.id=c.eid;