0% found this document useful (0 votes)
147 views1 page

Statement: Write The DDL and DML Statements For The Following

The document provides instructions for modifying database schemas and writing SQL queries. It asks to 1) extend tables to allow courses to have multiple teaching assistants, 2) alter the schema to allow students to have multiple advisors, 3) write queries to find students with more than 3 advisors or those co-advised by specific professors, and 4) write queries to delete old data or remove courses and cascading prerequisites.

Uploaded by

Shubham Devkate
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
0% found this document useful (0 votes)
147 views1 page

Statement: Write The DDL and DML Statements For The Following

The document provides instructions for modifying database schemas and writing SQL queries. It asks to 1) extend tables to allow courses to have multiple teaching assistants, 2) alter the schema to allow students to have multiple advisors, 3) write queries to find students with more than 3 advisors or those co-advised by specific professors, and 4) write queries to delete old data or remove courses and cascading prerequisites.

Uploaded by

Shubham Devkate
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 the DDL and DML statements for the following.

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.

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.

Write SQL queries on the modified schema. You will need to insert data to ensure the query
results are not empty.

Find all students who have more than 3 advisors


Find all students who are co-advised by Prof. Srinivas and Prof. Ashok.
Find students advised by instructors from different departments. etc.

Write SQL queries for the following:

Delete all information in the database which is more than 10 years old. Add data as
necessary to verify your query.

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