Test
MNSU CIS440 Fall 2020 Quiz 3
Preguntas del test (20)
1The special operator used to check whether an attribute value matches a given string pattern is __________.
- ABETWEEN
- BIS NULL
- CLIKE
- DIN
2The SQL aggrergate function that gives the number of rows containing non-null values for a given column is ____________.
- AMIN
- BMAX
- CSUM
- DCOUNT
3Which one of the following will be useful if there is a need to step through rows forward and backward?
- AStored Procedure
- BCursor
- CTrigger
- DIndex
4Which one of the following is essentially virtual tables?
- ACursor
- BView
- CTrigger
- DStored Procedure
5You can use a stored procedure that returns information from base tables that you do not have permission on.
- AVerdadero
- BFalso
6The WITH ENCRYPTION clause of the CREATE VIEW statement
- Aprevents users from modifying the view.
- Bprevents users from seeing the code the defines the view.
- Cprevents users from using the view without the appropriate authorization.
- Dcauses the data that's returned by the view to be encrypted.
7The statement
CREATE VIEW Example4
AS
SELECT *
FROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorID
WHERE InvoiceTotal - PaymentTotal - CreditTotal > 0;- Awill create an updatable view
- Bwill create a read-only view
- Cwill create a view through which you can update or insert rows, but not delete rows
- Dwill fail because the SELECT statement returns two columns named VendorID
8A table that's used to create a view is called
- Aa view table
- Ba temporary table
- Ca base table
- Dan OFFSET table
9Each of the following is a benefit provided by using views except for one. Which one is it?
- AYou can simplify data retrieval by hiding multiple join conditions.
- BYou can provide secure access to data by creating views that provided access only to certain columns and rows.
- CYou can create a view that simplifies data insertion by hiding a complex INSERT statement within the view.
- DYou can create custom views to accommodate different needs.
10A view
- Ais like a virtual table
- Bconsists only of the rows and columns specified in its CREATE VIEW statement
- Cdoesn't store any data itself
- DAll of the above (a, b, and c)
- EOnly statements a and b are correct
- FOnly statements a and c are correct
11The 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;- Awill fail because the GROUP BY clause isn't allowed in this view
- Bwill fail because the column alias SumOfInvoices is invalid
- Cwill fail because the ORDER BY clause isn't allowed in this view
- Dwill succeed
12If you delete a stored procedure, function, or trigger and then create it again
- Ayou delete the tables on which the object is based
- Byou disable access to the tables on which the object is based
- Cyou delete the security permissions assigned to the object
- Dnone of the above
13Each of the following statements about triggers is true except for one. Which one?
- AA trigger can't be directly called or invoked.
- BA trigger doesn't accept input or return output parameters.
- CA trigger can have more than one batch.
- DThe code of a trigger can execute in place of the action query to which it's assigned.
14Which statement can you use to manually raise an error within a stored procedure?
- ATHROW
- BERROR
- CTRY
- DRAISE
15Which of the following statements calls the stored procedure and passes the values '2019-10-01' and 122 to its input parameters/
CREATE PROC spInvoiceTotal1
@DateVar smalldatetime
@VendorID int
AS
SELECT SUM(InvoiceTotal)
FROM Invoices
WHERE VendorID = @VendorID AND InvoiceDate >= @DateVar;- ASELECT spInvoiceTotal1 @VendorID = 122, @DateVar = '2019-10-01';
- BCREATE spInvoiceTotal1 @VendorID = 122, @DateVar = '2019-10-01';
- CEXEC spInvoiceTotal1 @VendorID = 122, @DateVar = '2019-10-01';
- Dnone of the above
16A user-defined function
- Acan return a single scalar value or a single table value
- Bcan return multiple scalar values or a single table value
- Ccan return multiple scalar values or a multiple table values
- Dcan't accept input parameters
17Which statement can you use to control the flow of execution based on a true/false condition?
- AIF...ELSE
- BBEGIN...END
- CTRY...CATCH
- DEXEC
18Given the following statements that declare a local variable and set its value, which of the following will cause an error?
DECLARE @Example1 varchar(128);
SET @Example1 = 'Invoices';- AIF @Example1 = 'Invoices'
SELECT*
FROM Invoices - BPRINT 'Table name is: ' + @Example1;
- CSELECT *
FROM @Example1; - DSELECT *
FROM sys.tables
WHERE name = @Example1;
- AIF @Example1 = 'Invoices'
19When passing a list of parameters to a stored procedure by name, you can omit optional parameters by
- Aomitting the parameter name and value from the list
- Binserting an extra comma
- Cdeclaring the optional parameters after the required parameters
- Dusing the OUTPUT keyword
20A cursor that is sensitive to updates and deletes to the source data, but insensitive to insertions:
- Adynamic
- Bstatic
- Cforward-only
- Dkeyset-driven
Información
- Descripción
- Quiz 3 given in CIS 440 at Minnesota State University, Mankato in Fall 2020.
- Autor
- Kyle Peterson
- Idioma
- English
- Visitas
- 60
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test