














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















CREATE VIEW st_view1 AS (select stName, stFname, prName from student WHERE prName = 'MCS') View can be referred in SQL statements like tables
CREATE VIEW st_view2 AS (select stName, stFname, prName from student WHERE prName = ‘BCS') WITH CHECK OPTION
Update ST_VIEW2 set prName = ‘MCS’ Where stFname = ‘Loving’
Different attribute names
CREATE VIEW st_view3 (name, abbaG, pata) as (select stname, stfname, stadres from student)
Computed attributes Nesting of views CREATE VIEW enr_view AS (select * from enroll) CREATE VIEW enr_view1 as (select stId, crcode, smrks, mterm, smrks + mterm sessional from enr_view)
CREATE VIEW st_pr_view AS (select stName, stFname, student.prName, prcredits FROM student, program WHERE student.prname = program.prname)
SELEC * FROM st_pr_view
If single table, updation piece of cake (with check option) We can even insert data, BUT Not through computed attribute Cannot miss “Not NULL” attributes One of the multiple tables Not in case of aggregate functions
ALTER VIEW st_view1 as (SELECT stId, stName, stFname, prName from student where prName = 'MCS’) WITH CHECK OPTION
INSERT INTO st_view values ('S1044', ‘Ali Raza', ‘M. Raza ', 'BCS')