If I want to select a student where their student name has MOUSE atthe end, woul
ID: 3609888 • Letter: I
Question
If I want to select a student where their student name has MOUSE atthe end, would it be this?
I'm pretty sure I have the joins correct, just not sure about thewild card %.
SELECT sname FROM students s, faculty f,enrolled e, courses c
WHERE s.sid = e.sid and e.cid = c.cid AND snamelike 'Mouse%' AND c.fid = f.fid and f.name = 'J. Escalante';
Also if I want to group by color it would be this correct?
SELECT color, cname
FROM courses
GROUP color, cname;
Lastly if I want to count the # of courses after grouping it wouldbe:
SELECT color, count(*)
FROM courses
GROUP color;
The queries arnt running though so I think I have a syntax errorsomewhere, any ideas where it can be? Its driving menuts! I e-mailed the TA hopefllly she can get back to me intime before the exam.
Explanation / Answer
Hope this answers your question. Don't forget to RATE! (a) Use and rather than or. Also, since you are selecting the namesof the students which end with a Mouse use '%Mouse'. Here's the query: select sname from studens s, faculty f, enrollede, courses c where s.sid = e.sid and e.cid = c.cid and sname like'%Mouse' and c.fid = f.fid and f.name = 'J. Escalante'; (b) select color, cname from courses group by color, cname; (c) select color, count(*) from courses group by color;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.