Problem 5.6

a) SELECT Name, Major FROM STUDENT WHERE NOT EXISTS(SELECT * FROM GRADE_REPORT WHERE Student_number = STUDENT.Student_number AND NOT(GRADE = ‘A’));

b.SELECT Name, Major FROM STUDENT WHERE EXISTS((SELECT * FROM GRADE_REPORT AS R, STUDENT AS S WHERE R.Student_number = S.Student_number) EXCEPT (SELECT Student_number FROM GRADE_REPORT WHERE Grade = ‘A’));

Problem 5.7

a) SELECT LNAME FROM employee WHERE DNO=(SELECT DNO FROM employee WHERE SALARY = (SELECT MAX(SALARY) FROM employee));

Screen Shot 2015-12-20 at 11.35.15 AM

b)SELECT LNAME FROM employee WHERE SUPERSSN IN (SELECT SSN FROM employee WHERE SUPERSSN=’888665555′);

Screen Shot 2015-12-20 at 11.35.29 AM

c) SELECT LNAME FROM employee WHERE SALARY >= 10000+(SELECT MIN(SALARY) FROM employee);

Screen Shot 2015-12-20 at 11.35.44 AM

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>