Description
Assignment:
Write the following queries in SQL, using the university schema.
1.
I. Create two tables with table 1 as referenced table and table 2 as referencing table.
II. insert values in two tables and show two examples of all integrity constraint error.
III. also show ON DELETE CASCADE example.
IV. delete two tables
2.
I. backup databases with data and without data and store it as structure_with_data.sql
and structure_without_data.sql(show proof by taking screenshot of location where it
is stored)
II. restore these databases as name : with_data and without_data.(show proofs by
showing table)
III. delete these databases.
3.Find the total number of (distinct) students who have taken course sections taught by the
instructor with ID 110011(using nested subquery) .
4.Find the names of all instructors whose salary is greater than at least one instructor in the
Biology department(using nested subquery).
5.Write a query to list all departments along with the number of instructors in each
department(using nested subquery).
6.Write query to show instructor name with second highest salary.(using nested subquery).
7.Show toppers name,dept_name and total credits from dept with more than one
students.(using nested subquery)