Unit 1 Database Programming quiz

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which statement do you use to modify an existing view?

ALTER VIEW

Which statement do you use to delete an existing view?

DROP VIEW

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

Diagram pane

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

SELECT

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

SQL pane

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

View Designer

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

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

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

a base table

A view

all of the above

The View Designer allows you to

all of the above

The WITH SCHEMABINDING clause of the CREATE VIEW statement

all of the above

You can code views that

all of the above

The SELECT statement for a view

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

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

catalog views

By default,

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

The WITH CHECK option of the CREATE VIEW statement

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

The WITH ENCRYPTION clause of the CREATE VIEW statement

prevents users from seeing the code that defines the view

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

system catalog

The statement CREATE VIEW Example3 AS SELECT * FROM Invoices;

will create an updatable view

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;

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

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

will fail because the SELECT statement returns two columns named VendorID

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

will fail because the second column isn't named


Ensembles d'études connexes

Curriculum 4: Module 3: Measures of Leverage

View Set

MASCULINO, FEMENINO, SINGULAR, PLURAL

View Set

Business Law: Chapter 37 - All Forms of Partnerships

View Set

contribution to lower flexibility

View Set

NURS 420 community health practice test 4 (Ch 25-32)

View Set