0% found this document useful (0 votes)
83 views2 pages

(CA702) Lab Session #6

This document contains a practical sheet with details of students, colleges and their application status. It provides instructions to create various views on the provided data using SQL queries and perform operations like updating, inserting on those views.

Uploaded by

asif sheikh
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)
83 views2 pages

(CA702) Lab Session #6

This document contains a practical sheet with details of students, colleges and their application status. It provides instructions to create various views on the provided data using SQL queries and perform operations like updating, inserting on those views.

Uploaded by

asif sheikh
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/ 2

PRACTICAL SHEET - VI

Student Apply
sID sName GPA sizeHS sID cName major decision
123 Amy 3.9 1000 123 Stanford CS Y
234 Bob 3.6 1500 123 Stanford EE N
345 Craig 3.5 500 123 Berkeley CS Y
456 Doris 3.9 1000 123 Cornell EE Y
567 Edward 2.9 2000 234 Berkeley biology N
678 Fay 3.8 200 345 MIT bioengineering Y
789 Gary 3.4 800 345 Cornell bioengineering N
987 Helen 3.7 800 345 Cornell CS Y
876 Irene 3.9 400 345 Cornell EE N

765 Jay 2.9 1500 678 Stanford history Y


987 Stanford CS Y
654 Amy 3.9 1000
987 Berkeley CS Y
543 Craig 3.4 2000
876 Stanford CS N
College 876 MIT biology Y
cName state enrollment 876 MIT marine biology N
Stanford CA 15000 765 Stanford history Y
Berkeley CA 36000 765 Cornell history N
MIT MA 10000 765 Cornell psychology Y
Cornell NY 21000 543 MIT CS N
Harvard MA 50040

Write SQL queries for the following:


1. Create view WeakStudent on Student whose GPA is less than 3.7.
2. Create a view cView on college (containing all the columns) and rename the column
cName as collegeName and enrollment as seats respectively.
3. Create view CSaccept having IDs and college of student who applied to CS major and
their application is accepted.
4. Create view CSberkeley having IDs, name, GPA, sizeHS of those students who are
accepted in CS at Berkeley and comes from High School that is greater than 500.
(Instruction: You are required to use view CSaccept in this query with Student table
for joining)
5. Display information about student in CSberk having GPA greater than 3.8.
6. Drop view CSaccept.
7. Display all student in CSberkeley.
8. Update GPA by 0.8 of students in view WeakStudent who having high school size
greater than 1000.
9. Create a view AppCount which contains sID of Student and number of applications they
filed. Name the column sID and NoOfApp.
10. Update NoOfApp so that sID 234 contains 4 applications.
11. Create a view StuName contain student name and their GPA. Is this View Updatable?
If not specify why.
12. Create view studentHS having details of student comes from High School of size more
than 1000 using with check option.
13. Try insert detail of a new student Ram with sID 999 having GPA 9.9 and sizeHS 9999
to newly created view studentHS. (Comment is this view updatable?)
14. Clerk realize he wrongly type sizeHS of Ramu as 9999 it is actually 999. Can you help
him to update the value of sizeHS of Ramu.
15. Now, another boy registered to our system named Ramu with sID 998 having GPA 9.8
and sizeHS 989.

You might also like