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

Dbms Assignment On SQL

The document provides instructions for modifying database schemas and writing SQL queries. It includes: 1) Extending existing schemas to allow courses to have multiple teaching assistants and students to have multiple advisors. 2) Writing queries to find students with more than 3 advisors, students co-advised by two professors, and students advised by instructors in different departments. 3) Writing queries to delete information over 10 years old from the database and to delete a course along with any courses having it as a prerequisite.

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)
133 views1 page

Dbms Assignment On SQL

The document provides instructions for modifying database schemas and writing SQL queries. It includes: 1) Extending existing schemas to allow courses to have multiple teaching assistants and students to have multiple advisors. 2) Writing queries to find students with more than 3 advisors, students co-advised by two professors, and students advised by instructors in different departments. 3) Writing queries to delete information over 10 years old from the database and to delete a course along with any courses having it as a prerequisite.

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 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