0% found this document useful (0 votes)
9 views

Assignment 2b: Nested Subqueries and SQL Updates

Find courses without prerequisites and students who haven't taken biology courses. Update queries to give instructors a 10% raise, increase credits for students who took "Genetics", increase salary by $50,000 for advisors of 2+ students, and set credits to 2 for courses with less than 5 students total.

Uploaded by

mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Assignment 2b: Nested Subqueries and SQL Updates

Find courses without prerequisites and students who haven't taken biology courses. Update queries to give instructors a 10% raise, increase credits for students who took "Genetics", increase salary by $50,000 for advisors of 2+ students, and set credits to 2 for courses with less than 5 students total.

Uploaded by

mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment 2b: Nested Subqueries and SQL Updates

Statement: Write the following queries for university schema.

Find the id and title of all courses which do not require any prerequisites.
Find the names of students who have not taken any biology dept courses

Write SQL update queries to perform the following (queries 2 and 4 are pretty
meangless, but still fun to write):
1. Give a 10% hike to all instructors.
2. Increase the tot_creds of all students who have taken the course titled "Genetics" by
the number of credits associated with that course.
3. For all instructors who are advisors of atleast 2 students, increase their salary by 50000.
4. Set the credits to 2 for all courses which have less than 5 students taking them (across all
sections for the course, across all years/semesters).

You might also like