Shared Flashcard Set

Details

Views Lesson 7
This concerns views
15
Computer Science
Undergraduate 4
09/28/2013

Additional Computer Science Flashcards

 


 

Cards

Term
Views
Definition

They are just like tables

but offer security on the original table

They are portions or views allowed to be seen by the user

They can be quiered as well

Term
Materialize
Definition

Another word for populate

 

copies info into a resultset

 

Do all the JOINS and calculations!

 

This is sped up by indexing

Data entry in indexing however can be slow

Term
Can you update, insert and modify Views?
Definition

Yes

 

and you can modify them one base table at a time

Term
What are the restrictions in updating a view?
Definition
  • You can only update one base table at a time
  • You can't modify data in the view that uses aggregate functions
  • You cannot insert null values

 

To over come this you need to use

INSTEAD OF triggers

Term
What is Query Optimizer?
Definition
  • a component in SQL Server
  • It analyzes your queries
  • Compares quieries to available indexes
  • It decides which index returns a resultset fastest

incurs overhead and takes up disk space

Placing clustered index on a view might create duplicate columns on the DB

Term
Indexed View
Definition

ALTER DATABASE databaseName SET ANSI_NULLS ON

ALTER DATABASE databaseName SET QUOTED_iDENTIFIER ON

 

you cannot ref other views just tables

you can use alias data types but in NO SQL with external access property set to NO

 

lots of overhead

stored as separate objects looking like tables with clustered indexes

Term
Index Views' other restrictions
Definition
  • View in same database of same owner
  • create it with SCEHMABINDING option
  • To change the table you gotta drop the indexed view
  • you cannot access columns via *
  • you cannot reference a column twice in the SELECT statement
Term
Index Views' further restrictions
Definition
  • you can't alias functions unless you did so with SCHEMABINDING option
  • You can only use deterministic functions which are return the same value each time used DATEADD()
  • You can't use a derived table obtained from SELECT encased in (FROM...)
  • you can't use ROWSET, UNION, TOP, ORDERBY, DISTINCT, COUNT(*), COMPUTE, COMPUTEBY
  • CLR can appear only in the SELECT list of the view but not in WHERE or JOIN clauses
  • cannot use SELECT with CONTAINS and FREETEXT
Term
What is a deterministic function?
Definition

a function that returns the same value each time you use them

DATEADD() is an example of one

 

Term
What is a nondeterministic function?
Definition

GETDATE()

a function as listed above,

that returns different values each time they're invoked or used

Term
Index Views' further restrictions continued
Definition

You cannot use aggregate functions (which are considered determinstic and thus allowed ) WHEN

they are used in the SELECT statement:

AVG()

MAX()

MIN()

STDEV()
STDEVP()

VAR()
VARP()

Term
Index Views' further restrictions continued part 2
Definition

You cannot use HAVING, ROLLUP, CUBE

when using

GROUP BY

 

You have to use

COUNT_BIG()

Term
Partitioned View
Definition

displays across (horizontally)

divided data

from a set of member tables

across one or more

servers

as if it were coming from one table

Term
local partitioned view
Definition

tables and views

reside

on same instance

you use partitioned tables

rather than

partitioned views

Term
distributed partitioned view
Definition

at least one table participating in the view

resides on a different remote server

Supporting users have an ad free experience!