You are on page 1of 7

5/13/2021 campuslink.

admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

HCM21_CPL_JAVA_06    Tests & Quizzes

Tests & Quizzes

04_ASQL_Quiz2_SQL Advance 2
Show Feedback | Table of Contents

Part 1 of 1 -

Question 1 of 20
Which of the following is an SQL trigger Microsoft SQL Server supports? 5.0 Points

A. BEFORE

B. INSTEAD OF

C. AFTER

D. b and c only

Reset Selection

Question 2 of 20
SQL Server program code that is executed instead of an SQL command that needs to be processed 5.0 Points
is called a(n):

A. BEGIN trigger.

B. INSTEAD OF trigger.

C. AFTER trigger.

D. BEFORE trigger.

Reset Selection

Question 3 of 20
Unlike application code, stored procedures are never distributed to _______________ 5.0 Points

A. the DBMS

B. the client computers

C. the network servers

D. the database servers

Reset Selection

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 1/7
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

Question 4 of 20
You need to identify, within a given clause, if the month of February will contain 29 days for a 5.0 Points
specified year. Which object should you use?

A. DML trigger

B. Stored procedure

C. Scalar-valued function

D. Table-valued function

Reset Selection

Question 5 of 20
Because SQL stored procedures allow and encourage code sharing among developers, stored 5.0 Points
procedures give database application developers the advantages of ……………...

A. less work

B. standardized processing

C. specialization among developers

D. All of the mentioned options

Reset Selection

Question 6 of 20
Using SQL Server 2000, which of the following symbols is used to indicate parameters in stored 5.0 Points
procedures?

A. @

B. &

C. %

D. #

Reset Selection

Question 7 of 20
Your database contains two tables named DomesticSalesOrders and InternationalSalesOrders. 5.0 Points
Both tables contain more than 100 million rows. Each table has a Primary Key column named SalesOrderId.
The data in the two tables is distinct from one another. Business users want a report that includes aggregate
information about the total number of global sales and total sales amounts. You need to ensure that your
query executes in the minimum possible time. Which query should you use?

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 2/7
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

A. "SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM DomesticSalesOrders
UNION
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount
FROM InternationalSalesOrders
"

B. "SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION
SELECT SalesOrderId, SalesAmount
FROM InternationalSalesOrders
) AS p
"

C. "SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM DomesticSalesOrders
UNION ALL
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount
FROM InternationalSalesOrders
"

D. "SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION ALL
SELECT SalesOrderId, SalesAmount
FROM InternationalSalesOrders
) AS p
"

Reset Selection

Question 8 of 20
Which SQL trigger does SQL Server NOT support? 5.0 Points

A. SQL Server supports all three.

B. BEFORE

C. INSTEAD OF

D. AFTER

Reset Selection

Question 9 of 20
https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 3/7
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

Because SQL statements are set-oriented, whereas programs are element-oriented, the results of 5.0 Points
SQL statements used in programs are accessed using …………………..

A. standard programming tools

B. an SQL cursor

C. an SQL trigger

D. custom written programming tools

Reset Selection

Question 10 of 20
SQL triggers are created using ……………………. 5.0 Points

A. the SQL ADD CONSTRAINT TRIGGER statement

B. the SQL TRIGGER statement

C. the SQL CREATE TRIGGER statement

D. the SQL ADD TRIGGER statement

Reset Selection

Question 11 of 20
Which of the following is true concerning a procedure? 5.0 Points

A. They include procedural and SQL statements.

B. You do not create them with SQL.

C. They are the same thing as a function.

D. They do not need to have a unique name.

Reset Selection

Question 12 of 20
You are tasked to create a table that has a column that must store the current time accurate to ten 5.0 Points
microseconds. You need to use a system function in conjunction with the DEFAULT option in the column
definition. Which system function should you use?

A. CURRENT_TIMESTAMP

B. DATEADD

C. GETUTCDATE

D. SYSDATETIME

Reset Selection

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 4/7
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

Question 13 of 20
A _______________ is a stored program that is attached to a table or a view. 5.0 Points

A. pseudofile

B. embedded SELECT statement

C. trigger

D. None of the above is correct.

Reset Selection

Question 14 of 20
A function returns one value and has only output parameters. 5.0 Points

True
False
Reset Selection

Question 15 of 20
Which of the following is not an ANSI SQL trigger? 5.0 Points

A. BEFORE UPDATE

B. INSTEAD OF UPDATE

C. BEFORE INSERT

D. INSTEAD OF CONSTRAINT

Reset Selection

Question 16 of 20
Which of the following is true concerning triggers? 5.0 Points

A. They execute against only some applications that access a database.

B. You do not create them with SQL.

C. They have an event, condition, and action.

Reset Selection

Question 17 of 20
What is not an advantage of stored procedures? 5.0 Points

A. SQL can be optimized

B. Code sharing

C. Greater security

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 5/7
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

D. Increased network traffic

Reset Selection

Question 18 of 20
A stored program that is attached to the database is called __________________ 5.0 Points

A. a view

B. a CHECK constraint

C. a trigger

D. a stored procedure

Reset Selection

Question 19 of 20
You have a third-party application that inserts data directly into a table. You add two new columns to 5.0 Points
the table. These columns cannot accept NULL values and cannot use default constraints. You need to ensure
that the new columns do not break the third-party application. What should you do?

A. Create a stored procedure.

B. Create a DDL trigger.

C. Create an INSTEAD OF INSERT trigger.

D. Create an AFTER INSERT trigger.

Reset Selection

Question 20 of 20
If a trigger is being written to enforce referential integrity actions, you cannot use …………. 5.0 Points

A. a BEFORE trigger

B. an INSTEAD OF trigger

C. an AFTER trigger

D. depending on the specific referential integrity action, either b or c may be disallowed

Reset Selection

Save Exit Submit for Grading

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 6/7
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

Gateway
Accessibility Information
The Sakai Project

Powered by Sakai
Copyright 2017 FPT-Software

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/delivery/beginTakingAss… 7/7

You might also like