Download presentation
Presentation is loading. Please wait.
Published byAlan Boone Modified over 9 years ago
1
Jennifer Widom Views Defining and Using Views
2
Jennifer Widom Defining & Using Views Three-level vision of database Physical – Conceptual – Logical
3
Jennifer Widom Defining & Using Views Why use views? Hide some data from some users Make some queries easier / more natural Modularity of database access Real applications tend to use lots and lots (and lots and lots!) of views
4
Jennifer Widom Defining & Using Views Defining and using views View V = ViewQuery(R 1, R 2, …, R n ) Schema of V is schema of query result Query Q involving V, conceptually: In reality, Q rewritten to use R 1,…,R n instead of V Note: R i could itself be a view V := ViewQuery(R 1,R 2,…,R n ) Evaluate Q
5
Jennifer Widom Defining & Using Views SQL Syntax Create View Vname As
6
Jennifer Widom Defining & Using Views SQL Syntax Create View Vname(A 1,A 2,…,A n ) As Demo: simple college admissions database College(cName,state,enrollment) Student(sID,sName,GPA,sizeHS) Apply(sID,cName,major,decision)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.