Professional Documents
Culture Documents
• (select course_id
• from section
• where semester = ’Fall’ and year = 2009)
except
• (select course id
• from section
• where semester = ’Spring’ and year = 2010);
Nested Subqueries
• Find all the courses taught in the Fall 2009
semester but not in the Spring 2010 semester.
• select distinct course_id
• from section
• where semester = ’Fall’ and year = 2009 and
course_id not in (select course_id
from section
where semester = ’Spring’ and
year = 2010);
Nested Subqueries
• Find the names of instructors whose names
are neither “Mozart” nor “Einstein”.
Nested Subqueries
• Find the names of instructors whose names
are neither “Mozart” nor “Einstein”.
• Update instructor
• set salary = salary *0.05
• where salary < 70000;
Updates
• Give a 5 percent salary raise to instructors
whose salary is less than average.
Updates
• Give a 5 percent salary raise to instructors
whose salary is less than average.
• Update instructor
• set salary = salary *0.05
• where salary < (select avg (salary )
from instructor)