CIS407 Exam 2

studied byStudied by 1 person
5.0(1)
Get a hint
Hint

Which statement do you use to delete an existing view?

1 / 47

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

48 Terms

1

Which statement do you use to delete an existing view?

DROP VIEW

New cards
2

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

a base table

New cards
3

The WITH ENCRYPTION clause of the CREATE VIEW statement

prevents users from seeing the code that defines the view

New cards
4

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.

New cards
5

You can code views that

join tables, summarize data, and use subqueries and functions

New cards
6

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

SQL Pane

New cards
7

Which statement do you use to modify an existing view?

ALTER VIEW

New cards
8

By default,

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

New cards
9

A view

is like a virtual table, consists only of the rows and columns specified in its CREATE VIEW statement, doesn't store any data itself

New cards
10

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

catalog views

New cards
11

You use data definition language (DDL) to create, modify, and delete the ________________ of a database.

objects, sequences, table

New cards
12

Which of the following statements about the SPARSE attribute is true?

It optimizes the storage of null values for a column, It requires more overhead to retrieve non-null values, You should only use it when a column contains a high percentage of null values

New cards
13

What attribute can you use to optimize storage when coding the definition for a column that will contain a high percentage of null values?

SPARSE

New cards
14

A regular identifier

can contain a number sign (#)

New cards
15

When you define a foreign key constraint, you can specify all but one of the following. Which one is it?

that the insertion of a row in a foreign key table that has a foreign key that isn't matched in the primary key table should be cascaded up to the primary key table

New cards
16

Each of the following column attributes is a column constraint, except

DEFAULT

New cards
17

When you use the CREATE TABLE statement to create a table, you can also define the attributes and ______________ for the columns.

constraints

New cards
18

What kind of constraint limits the values that can be stored in a column?

check constraint

New cards
19

When you code a table-level check constraint, the constraint can refer to data in more than one

column

New cards
20

Which statement is used to modify the structure of an existing table?

ALTER TABLE

New cards
21

If introduced as follows, the subquery can return which of the values listed below? SELECT (subquery)

a single value

New cards
22

If introduced as follows, the subquery can return which of the values listed below?WHERE VendorID NOT IN (subquery)

a column of one or more rows

New cards
23

A subquery is a/an ______________ statement that's coded within another SQL statement.

SELECT

New cards
24

You can't update

an identity column

New cards
25

If you code a column list in an INSERT statement that includes a column that has a default value, which keyword can you code in the VALUES clause to use the default value?

DEFAULT

New cards
26

To insert several rows selected from another table into a table, you can code an INSERT statement with a/an ______________ in place of the VALUES clause.

subquery

New cards
27

You use the UPDATE statement to modify one or more rows in the table named in the ________________ clause.

UPDATE

New cards
28

When you code a column list in an INSERT statement, you can omit identity columns, columns that have default values, and columns that allow __________ values.

null

New cards
29

When you use the SELECT INTO statement, the result set that's defined by the SELECT statement is ________________ a new table.

copied into

New cards
30

The integer and decimal data types are considered ________________ because their precision is exact.

exact numeric data types

New cards
31

Write the code for an ORDER BY clause that sorts a table into numeric sequence by the data in the PartCode column if that column contains whole numbers that are stored with the varchar data type.

ORDER BY CAST (PartCode AS int)

New cards
32

Which data types are used to store whole numbers?

integer

New cards
33

The difference between the CAST function and the CONVERT function is that the ________________ function accepts an optional style argument that lets you specify a format for the result

CONVERT

New cards
34

Which function is typically used to insert control characters into a character string?

CHAR

New cards
35

If you omit both NULL and NOT NULL from the list of column attributes in a CREATE TABLE statement, which is the default setting?

NULL

New cards
36

A collation can affect all of the following except one. Which one?

how character data is concatenated

New cards
37

When you code a script for creating a database,

you need to create the referred to tables before you create the tables that refer to them

New cards
38

The CREATE TABLE statement

creates a new table in the current database

New cards
39

If introduced as follows, the subquery can return which of the values listed below?WHERE InvoiceTotal > ALL (subquery)

a column of one or more rows

New cards
40

A subquery can be coded in a WHERE, FROM, SELECT, or ______________ clause.

HAVING

New cards
41

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

table

New cards
42

If introduced as follows, the subquery can return which of the values listed below?SELECT (subquery)

a single value

New cards
43

Code example 6-1SELECT VendorName, COUNT(*) AS NumberOfInvoices,MAX(InvoiceTotal - PaymentTotal - CreditTotal) AS BalanceDueFROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorIDWHERE InvoiceTotal - PaymentTotal - CreditTotal >(SELECT AVG(InvoiceTotal - PaymentTotal - CreditTotal)FROM Invoices)GROUP BY VendorNameORDER BY BalanceDue DESC; (Please refer to code example 6-1.) When this query is executed, the NumberOfInvoices column for each row will show the number

of invoices for each vendor that have a larger balance due than the average balance due for all invoices

New cards
44

Write the code for a DELETE statement that deletes every row in the Vendors table

DELETE Vendors;

New cards
45

When you code an UPDATE statement for one or more rows, the SET clause specifies the new data for the specified columns and the _________________ clause specifies which row or rows are to be updated.

WHERE

New cards
46

In an UPDATE statement, the WHERE clause will

specifiy the condition a row must meet to be updated

New cards
47

You specify the conditions that must be met for a row to be deleted in the which clause?

WHERE

New cards
48

In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the columns are identity columns, and that none of them have default values or accept null values. What's wrong with the statement?INSERT INTO InvoiceCopy(VendorID, InvoiceNumber, InvoiceTotal, PaymentTotal, CreditTotal,TermsID, InvoiceDate, InvoiceDueDate)VALUES(97, '456789', 8344.50, 0, 0, 1, '2016-08-01');

The number of items in the column list doesn't match the number in the VALUES list.

New cards

Explore top notes

note Note
studied byStudied by 57 people
... ago
5.0(1)
note Note
studied byStudied by 4 people
... ago
5.0(1)
note Note
studied byStudied by 24 people
... ago
5.0(1)
note Note
studied byStudied by 16 people
... ago
5.0(1)
note Note
studied byStudied by 21 people
... ago
5.0(1)
note Note
studied byStudied by 22 people
... ago
5.0(2)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 331 people
... ago
5.0(6)

Explore top flashcards

flashcards Flashcard (105)
studied byStudied by 20 people
... ago
5.0(1)
flashcards Flashcard (184)
studied byStudied by 920 people
... ago
4.0(5)
flashcards Flashcard (79)
studied byStudied by 7 people
... ago
5.0(2)
flashcards Flashcard (26)
studied byStudied by 12 people
... ago
5.0(1)
flashcards Flashcard (63)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (57)
studied byStudied by 4 people
... ago
4.0(1)
flashcards Flashcard (109)
studied byStudied by 466 people
... ago
3.8(5)
robot