SlideShare a Scribd company logo
1 of 20
Introduction to Views Module 5
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Contents
Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction to Views ,[object Object],[object Object],[object Object],[object Object]
Introduction to Views (Continued) ,[object Object],[object Object],[object Object]
Advantages of Views ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example of a Views   This example shows creating a view called ‘ViewPublishers’ from the Publishers table. This view contains two columns ‘Pubid’ and ‘Pubname’ which are taken from the table. The actual data will be in the Publishers  table, which can be  viewed and manipulated from the ‘ViewPublishers’ view. Publishers PARIS IL Chicago Five lake 1622 USA CA Berkely Algodata 1389 USA DC Washington Binnet  0877 CHICAGO MA Boston New Moon  0736 Country State City Pubname Pubid ViewPublishers Five lake 1389 Algodata 0877 Binnet 0736 Pubname Pubid
To Create  Views ,[object Object],[object Object],[object Object],CREATE VIEW <ViewName> AS <Select Statement> CREATE VIEW ViewPublishers As SELECT * FROM Publishers CREATE VIEW ViewPublishers  AS SELECT  pubid, pubname , city FROM Publishers WHERE city =‘paris’
Simple views  ,[object Object],[object Object],[object Object],[object Object],[object Object],This example creates a simple view  ViewPublisher  which selects  all the data from Publishers Table CREATE VIEW ViewPublisher AS SELECT * FROM Publishers
Complex Views ,[object Object],[object Object],[object Object],[object Object],The example creates a complex view Dept_vw which selects the department name, minimum salary, maximum salary, and average salary. It uses three Aggregate functions and it joins two tables Employee and Department. CREATE VIEW Dept_vw  (deptname,minSalary,maxSalary,avgSalary) AS  SELECT d.deptName,min(e.salary),max(e.salary),avg(e.salary) FROM  Employee e, Department d WHERE  e.deptId = d.deptId GROUP BY d.deptName
View With Check option ,[object Object],[object Object],[object Object],CREATE VIEW empdept_vw as select empno,ename,deptno from emp where deptno =30 With check option; The example uses ‘With Check Option’ clause, which will restrict the insertion of a row that cannot be selected by the view
To Alter Views ,[object Object],[object Object],[object Object],Alters the view to add publishers’ country column of the Publishers table ALTER VIEW ViewPublishers As SELECT pubid, pubname, pubcity, country From publishers
To Drop Views ,[object Object],[object Object],DROP VIEW <ViewName>
To Rename Views ,[object Object],[object Object],[object Object],[object Object],sp_rename <Old_ViewName>,<New_ViewName> sp_rename Viewpublisher, VpubDetails
To Get  Information on view ,[object Object],[object Object],[object Object],[object Object]
To Get  Information on view (Continued) ,[object Object],[object Object],[object Object]
Key Points ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activity Time (30 minutes) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activity Time (30 minutes) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions & Comments

More Related Content

What's hot

What's hot (20)

Query Analyser , SQL Server Groups, Transact –SQL
Query Analyser , SQL Server Groups, Transact –SQLQuery Analyser , SQL Server Groups, Transact –SQL
Query Analyser , SQL Server Groups, Transact –SQL
 
View
ViewView
View
 
Sql viwes
Sql viwesSql viwes
Sql viwes
 
Computing assignment 02 ms access (bilal maqbool 10) se-i
Computing assignment 02   ms access (bilal maqbool 10)          se-iComputing assignment 02   ms access (bilal maqbool 10)          se-i
Computing assignment 02 ms access (bilal maqbool 10) se-i
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
View & index in SQL
View & index in SQLView & index in SQL
View & index in SQL
 
My first slide
My first slideMy first slide
My first slide
 
SQL
SQLSQL
SQL
 
Create an android app for database creation using.pptx
Create an android app for database creation using.pptxCreate an android app for database creation using.pptx
Create an android app for database creation using.pptx
 
Lab1-android
Lab1-androidLab1-android
Lab1-android
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Android interface elements and controls-chapter8
Android interface elements and controls-chapter8Android interface elements and controls-chapter8
Android interface elements and controls-chapter8
 
Manual de macros en calc
Manual de macros en calcManual de macros en calc
Manual de macros en calc
 
Oracle truncate&amp;alter (1)
Oracle truncate&amp;alter (1)Oracle truncate&amp;alter (1)
Oracle truncate&amp;alter (1)
 
Android app
Android appAndroid app
Android app
 
Backendless apps
Backendless appsBackendless apps
Backendless apps
 
Dataweave by nagarjuna
Dataweave  by nagarjunaDataweave  by nagarjuna
Dataweave by nagarjuna
 
Part 26 login type2 using binding source count
Part 26 login type2 using binding source countPart 26 login type2 using binding source count
Part 26 login type2 using binding source count
 
Android - Saving data
Android - Saving dataAndroid - Saving data
Android - Saving data
 

Viewers also liked

Multi-thematic spatial databases
Multi-thematic spatial databasesMulti-thematic spatial databases
Multi-thematic spatial databasesConor Mc Elhinney
 
Transact sql data definition language - ddl- reference
Transact sql data definition language - ddl- referenceTransact sql data definition language - ddl- reference
Transact sql data definition language - ddl- referenceSteve Xu
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012Steve Xu
 
High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Developmentdrywallbmb
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developersllangit
 
X query language reference
X query language referenceX query language reference
X query language referenceSteve Xu
 
Alasql.js - SQL сервер на JavaScript
Alasql.js - SQL сервер на JavaScriptAlasql.js - SQL сервер на JavaScript
Alasql.js - SQL сервер на JavaScriptAndrey Gershun
 
Spatialware_2_Sql08
Spatialware_2_Sql08Spatialware_2_Sql08
Spatialware_2_Sql08Mike Osbourn
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developersllangit
 
Css introduction
Css introductionCss introduction
Css introductionSridhar P
 
Sql server ___________session3-normailzation
Sql server  ___________session3-normailzationSql server  ___________session3-normailzation
Sql server ___________session3-normailzationEhtisham Ali
 
Alasql - база данных SQL на JavaScript (MoscowJS)
Alasql - база данных SQL на JavaScript (MoscowJS)Alasql - база данных SQL на JavaScript (MoscowJS)
Alasql - база данных SQL на JavaScript (MoscowJS)Andrey Gershun
 
Multidimensional model programming
Multidimensional model programmingMultidimensional model programming
Multidimensional model programmingSteve Xu
 

Viewers also liked (20)

Module03
Module03Module03
Module03
 
Multi-thematic spatial databases
Multi-thematic spatial databasesMulti-thematic spatial databases
Multi-thematic spatial databases
 
SQL Server 2008 Spatial Data - Getting Started
SQL Server 2008 Spatial Data - Getting StartedSQL Server 2008 Spatial Data - Getting Started
SQL Server 2008 Spatial Data - Getting Started
 
Transact sql data definition language - ddl- reference
Transact sql data definition language - ddl- referenceTransact sql data definition language - ddl- reference
Transact sql data definition language - ddl- reference
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012
 
High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Development
 
Module01
Module01Module01
Module01
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
 
X query language reference
X query language referenceX query language reference
X query language reference
 
Module07
Module07Module07
Module07
 
Alasql.js - SQL сервер на JavaScript
Alasql.js - SQL сервер на JavaScriptAlasql.js - SQL сервер на JavaScript
Alasql.js - SQL сервер на JavaScript
 
Module06
Module06Module06
Module06
 
Spatialware_2_Sql08
Spatialware_2_Sql08Spatialware_2_Sql08
Spatialware_2_Sql08
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Css introduction
Css introductionCss introduction
Css introduction
 
Sql server ___________session3-normailzation
Sql server  ___________session3-normailzationSql server  ___________session3-normailzation
Sql server ___________session3-normailzation
 
Alasql - база данных SQL на JavaScript (MoscowJS)
Alasql - база данных SQL на JavaScript (MoscowJS)Alasql - база данных SQL на JavaScript (MoscowJS)
Alasql - база данных SQL на JavaScript (MoscowJS)
 
Module04
Module04Module04
Module04
 
Module08
Module08Module08
Module08
 
Multidimensional model programming
Multidimensional model programmingMultidimensional model programming
Multidimensional model programming
 

Similar to Views Module Introduction

Sql server ___________session_16(views)
Sql server  ___________session_16(views)Sql server  ___________session_16(views)
Sql server ___________session_16(views)Ehtisham Ali
 
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating ViewsMS SQL SERVER: Creating Views
MS SQL SERVER: Creating Viewssqlserver content
 
La6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsLa6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsAzmiah Mahmud
 
La6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsLa6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsKak Yong
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLAkhil Mittal
 
need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxniraj57
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universitylhkslkdh89009
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorialonlinetrainingplacements
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL IISankhya_Analytics
 
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesPostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesSperasoft
 

Similar to Views Module Introduction (20)

Sql server ___________session_16(views)
Sql server  ___________session_16(views)Sql server  ___________session_16(views)
Sql server ___________session_16(views)
 
Les11
Les11Les11
Les11
 
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating ViewsMS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
 
MS SQLSERVER:Creating Views
MS SQLSERVER:Creating ViewsMS SQLSERVER:Creating Views
MS SQLSERVER:Creating Views
 
Les10
Les10Les10
Les10
 
La6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsLa6 ict-topic-6-information-systems
La6 ict-topic-6-information-systems
 
Oracle view
Oracle viewOracle view
Oracle view
 
L6-information-systems
L6-information-systemsL6-information-systems
L6-information-systems
 
La6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsLa6 ict-topic-6-information-systems
La6 ict-topic-6-information-systems
 
L6-information-systems
L6-information-systemsL6-information-systems
L6-information-systems
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docx
 
View
ViewView
View
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorial
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
 
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesPostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 

Recently uploaded

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

Views Module Introduction

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Example of a Views This example shows creating a view called ‘ViewPublishers’ from the Publishers table. This view contains two columns ‘Pubid’ and ‘Pubname’ which are taken from the table. The actual data will be in the Publishers table, which can be viewed and manipulated from the ‘ViewPublishers’ view. Publishers PARIS IL Chicago Five lake 1622 USA CA Berkely Algodata 1389 USA DC Washington Binnet 0877 CHICAGO MA Boston New Moon 0736 Country State City Pubname Pubid ViewPublishers Five lake 1389 Algodata 0877 Binnet 0736 Pubname Pubid
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.

Editor's Notes

  1. Faculty Notes: Views are virtual tables (tables which don’t occupy memory) whose contents are taken or derived from other tables. Just like other table, a view consists of rows with columns, and you can retrieve data from a view. Views can be used to join two tables in database and present the underlying data as if the data were coming from a single table Views can be used as a security mechanism to restrict the data available to end users Views can also be used to aggregate data
  2. Faculty Notes: A VIEW is basically a table that only exists when you use the view in a query. It is considered a virtual table because it acts like a table in the sense that the operations that can be performed on a table can be performed on a view. This virtual table does not exist in the database. It gets created when we use the view and then deleted. The named VIEW is the only thing that persists.
  3. Faculty Notes: Views make your life easier by simplifying your complex queries into a simple command. You won’t have to create complicated joins and subqueries repeatedly when you create a view instead. Your view hides the complexity of the underlying query. You can create views that hide information that isn’t needed by the user. You can allow users to see just the information they need, while keeping the sensitive information hidden using a view.
  4. Faculty Notes: Focuses data for users : It can be used as security mechanism by allowing user to access data through view, without granting permission to directly access the base table. Hides data complexity : Views hide the complexity of the database design from the user. This enables developers to change database design without affecting user interaction with the database. Simplifies permission management : Instead of granting permission to users for querying specific columns of the base tables,database owners can grant them permission for querying data only through views. Organizes data for export to other applications : User can create view based on a complex query that joins two or more tables. This appears to the user as single table. Reduces object size: views do not contain data, server stores only the definition of the view in the database
  5. Faculty Notes: Instructor has to Use inbuilt database table Database: Pubs Tables Publishers
  6. Faculty Notes: The example creates a simple view ViewPublisher which selects all the data from Publisher Table.
  7. Faculty Notes: The syntax of Complex view is similar to Create View Complex view is a view which normally contains GROUP BY as well as joins. Data in the underlying tables cannot be updated using Complex views.
  8. Faculty Notes: The “With Check option” clause specifies that Inserts and Updates performed through the View are not allowed to create rows which the view cannot select, and therefore allows integrity constraints and data validation checks to be enforced on data begin Inserted or Updated. For instance, Through this view you would not be able to insert data where deptno is anything other that 30.
  9. Faculty Notes: If you need to change the view itself without losing on it’s name along with the permissions set for the view, you may choose to alter the view rather than deleting the existing view and creating a new view with the same name.
  10. Faculty notes: There are some system stored procedures that help retrieve information on views . sp_help: This system stored procedure displays view related information. sp_depends: Determines the dependencies by looking at the sys.sql_dependencies view. sp_helptext: Retrieves and displays the view definition.The object must be in the current database.
  11. Faculty Notes: sp_columns: This stored procedure is equivalent to SQLCOLUMS in ODBC.