100% found this document useful (1 vote)
347 views

Assignment 3: SQL DDL and Updates

This document provides instructions for writing DDL and update queries for a student/course database. It asks to: 1) Increase salaries of instructors advising 2+ students by $50,000; 2) Alter tables to allow courses to have multiple TAs and students to have multiple advisors; 3) Delete course CS 101 and remove it as a prerequisite for other courses, creating a cascade constraint to enforce this.

Uploaded by

aniket
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
347 views

Assignment 3: SQL DDL and Updates

This document provides instructions for writing DDL and update queries for a student/course database. It asks to: 1) Increase salaries of instructors advising 2+ students by $50,000; 2) Alter tables to allow courses to have multiple TAs and students to have multiple advisors; 3) Delete course CS 101 and remove it as a prerequisite for other courses, creating a cascade constraint to enforce this.

Uploaded by

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

Assignment 3: SQL DDL and updates

Statement: Write DDL and update queries for the given statements.
A. Write SQL update queries to perform the following.
1. For all instructors who are advisors of at least 2 students, increase their salary by 50000.

B. Write the DDL and DML statements for the following.


1. Each offering of a course (i.e. a section) can have many Teaching assistants; each
teaching assistant is a student. Extend the existing schema(Add/Alter tables) to
accommodate this requirement.
2. According to the existing schema, one student can have only one advisor. Alter the
schema to allow a student to have multiple advisors and make sure that you are able to
insert multiple advisors for a student.
3. Write SQL queries for the following:
 Delete the course CS 101. Any course which has CS 101 as a prereq should remove
CS 101 from its prereq set. Create a cascade constraint to enforce the above rule, and
verify that it is working.

You might also like