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

Making sure my queries are correct, the exam is coming up and thehomework won\'t

ID: 3609889 • Letter: M

Question

Making sure my queries are correct, the exam is coming up and thehomework won't be returned until after the exam :(


Find the names of courses that have at least 2 students with rnogreater than 5.
I was reading up on VIEWS and it seems like they would work nice inthis query or maybe even just a lot of subqueries, but then againthere might be security issues with that. VIews i heard arn'tthat secure becuase someone might be able to modify the internaldata.

   SELECT * from (SELECT cname, count(*) asENROLLEDSTUDENTS
FROM courses C, students S, enrolled E
WHERE S.sid = E.sid and E.cid = C.cid and (SELECT count(*)from students where rno > 5) GROUP cname) AS tempTablewhere ENROLLEDSTUDNETS > 2;


Find the names of students not enrolled in any class
    
   SELECT * FROM students s
WHERE s.sid NOT IN (select sid FROM enrolled);

Sorry its pretty messy.

Explanation / Answer

(selectcid from enrolled where sid in

select sidfrom enrolled);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote