














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An in-depth exploration of views in database management systems. It covers the creation of views using different attribute names and computed attributes, as well as the nesting of views. The document also explains how views can include data from multiple tables through joins. Additionally, it discusses the rules for updating data in views.
Typology: Slides
1 / 22
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')