Chapter 13 Flashcards

1
Q

Which statement do you use to modify an existing view?

A

ALTER VIEW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The WITH CHECK option of the CREATE VIEW statement

A

prevents an update from being performed through the view if it causes a row to no longer be included in the view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following should you use to select the columns for a view in the View Designer?

A

Diagram pane

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

One way to examine the system objects that define a database is to use

A

catalog views

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The statement

CREATE VIEW Example3
AS
SELECT *
FROM Invoices;

A

will create an updatable view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A common table expression (CTE) creates a temporary _____________ that can be used by a query that follows.

A

table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following can you use to create or modify a view in SQL Server Management Studio?

A

View Designer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

By default,

A

columns in a view are given the same names as the columns in the base tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The WITH SCHEMABINDING clause of the CREATE VIEW statement

A

protects the view by binding it to the database schema

prevents the tables that the view is based on from being deleted

prevents the tables that the view is based on from being modified in a way that affects the view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A correlated subquery is one that

A

is executed once for each row in the outer query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

All of the system objects that define a database are stored in

A

a system catalog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which statement do you use to delete an existing view?

A

DROP VIEW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Each of the following is a benefit provided by using views except for one. Which one is it?

You can simplify data retrieval by hiding multiple join conditions.

You can provide secure access to data by creating views that provide access only to certain columns or rows.

You can create a view that simplifies data insertion by hiding a complex INSERT statement within the view.

You can create custom views to accommodate different needs.

A

You can create a view that simplifies data insertion by hiding a complex INSERT statement within the view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The SELECT statement for a view

A

can use the ORDER BY clause if it also uses the TOP clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The statement

CREATE VIEW Example4
AS
SELECT *
FROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorID
WHERE InvoiceTotal - PaymentTotal - CreditTotal > 0;

A

will fail because the SELECT statement returns two columns named VendorID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The statement

CREATE VIEW Example2
AS
SELECT InvoiceNumber,
       DATEDIFF(day,InvoiceDate,InvoiceDueDate)
FROM Invoices;
A

will fail because the second column isn’t named

17
Q

The WITH ENCRYPTION clause of the CREATE VIEW statement

A

prevents users from seeing the code that defines the view

18
Q

A view is a/an ________________ statement that’s stored as an object in the database

A

SELECT

19
Q

The statement

CREATE VIEW Example1
AS
SELECT VendorName, SUM(InvoiceTotal) AS SumOfInvoices
FROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorID
GROUP BY VendorName
ORDER BY VendorName;

A

will fail because the ORDER BY clause isn’t allowed in this view

20
Q

The View Designer allows you to

A

display the results of a view

specify the selection criteria and sort order for a view

edit the design of an existing view

21
Q

A view

A

is like a virtual table

consists only of the rows and columns specified in its CREATE VIEW statement

doesn’t store any data itself

22
Q

Which of the following should you use to view the code that’s generated for a view in the View Designer?

A

SQL pane

23
Q

You can code views that

A

join tables

summarize data

use subqueries and functions

24
Q

A table that’s used to create a view is called

A

a base table