Views in SQL

Views:
 
Category: Education
     
 

Presentation Description

Views in SQL

Comments

Presentation Transcript

Views in SQL : 

Views in SQL

Views : 

Views A view is just a relation, but we store a definition, rather than a set of tuples. CREATE VIEW YoungActiveStudents (name, grade) AS SELECT S.name, E.grade FROM Students S, Enrolled E WHERE S.sid = E.sid and S.age<21 Views can be dropped using the DROP VIEW command. How to handle DROP TABLE if there’s a view on the table? DROP TABLE command has options to let the user specify this.

Example - 2 : 

Example - 2 CREATE VIEW B-Students (name, sid , course) AS SELECT S.name, S.sid , E.cid FROM Students S, Enrolled E WHERE S.sid = E.studid AND E.grade =‘B’

Views , Data Independence , Security : 

Views , Data Independence , Security External Schema can be defined usin the view mechanism Views are also valuable in the context of security. We can define views that give a group of users access to just the information they are allowed to see

Slide 5: 

Updates on Views Destroying/Altering Tables and Views

Views and Security : 

Views and Security Views can be used to present necessary information (or a summary), while hiding details in underlying relation(s). Given YoungStudents, but not Students or Enrolled, we can find students s who have are enrolled, but not the cid’s of the courses they are enrolled in.

authorStream Live Help