Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

5/18/2021 campuslink.

admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

HCM21_CPL_JAVA_06    Tests & Quizzes

Tests & Quizzes

04_ASQL_Quiz2_SQL Advance 2
Return to Assessment List

Part 1 of 1 - 85.0/ 100.0 Points

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

A. INSTEAD OF CONSTRAINT

B. BEFORE UPDATE

C. BEFORE INSERT

D. INSTEAD OF UPDATE

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

A. a trigger

B. a CHECK constraint

C. a view

D. a stored procedure

Question 3 of 20
You have been tasked to delete a number of Database Mail messages that have been sent. 5.0/ 5.0 Points
You need to delete all the emails that were sent more than one month ago. Which Transact-SQL statements
should you run?

A. "DECLARE @OneMonthAgo datetime = DATEADD(mm,-1,GETDATE())


EXEC msdb.dbo.sysmail_delete_log_sp @OneMonthAgo,'Success' "

B. "DECLARE @OneMonthAgo datetime = DATEADD(mm,-1,GETDATE())


EXEC msdb.dbo.sysmail_delete_log_sp @OneMonthAgo "

C. "DECLARE @OneMonthAgo datetime = DATEADD(mm,-1,GETDATE())


EXEC msdb.dbo.sysmail_delete_mailitems_sp @OneMonthAgo,'Sent'"
https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 1/6
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

D. "DECLARE @OneMonthAgo datetime = DATEADD(mm,-1,GETDATE())


EXEC msdb.dbo.sysmail_delete_mailitems_sp @OneMonthAgo "

Question 4 of 20
If a trigger is being written to enforce referential integrity actions, you cannot use …………. 5.0/ 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

Question 5 of 20
You are tasked to create a table that has a column that must store the current time accurate to 5.0/ 5.0 Points
ten 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. DATEADD

B. CURRENT_TIMESTAMP

C. GETUTCDATE

D. SYSDATETIME

Question 6 of 20
You have a third-party application that inserts data directly into a table. You add two new 5.0/ 5.0 Points
columns to 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 an INSTEAD OF INSERT trigger.

B. Create a stored procedure.

C. Create an AFTER INSERT trigger.

D. Create a DDL trigger.

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

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

A. pseudofile

B. embedded SELECT statement

C. trigger

D. None of the above is correct.

Question 8 of 20
Embedded SQL is which of the following? 5.0/ 5.0 Points

A. Hard-coded SQL statements in a procedure.

B. Hard-coded SQL statements in a program language such as Java.

C. Hard-coded SQL statements in a trigger.

D. The process of making an application capable of generating specific SQL code on the fly.

Question 9 of 20
The code to create triggers and routines is stored in only one location and is administered 5.0/ 5.0 Points
centrally.

True
False

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

True
False

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

A. the SQL TRIGGER statement

B. the SQL ADD CONSTRAINT TRIGGER statement

C. the SQL ADD TRIGGER statement

D. the SQL CREATE TRIGGER statement

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

Question 12 of 20
Which of the following is true concerning triggers? 5.0/ 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.

Question 13 of 20
SQL Server program code that is executed after an SQL command has been processed is 5.0/ 5.0 Points
called a(n):

A. INSTEAD OF trigger.

B. AFTER trigger.

C. BEFORE trigger.

D. BEGIN trigger.

Question 14 of 20
SQL Server 2000 stored procedures can: 5.0/ 5.0 Points

A. be stored on the users' computer.

B. support BEFORE, INSTEAD OF and AFTER types.

C. be kept within the database and invoked by application programs.

D. never be kept within the database.

Question 15 of 20
The Enterprise manager cannot be used to modify stored procedures? 5.0/ 5.0 Points

True
False

Question 16 of 20
The following SQL statement is curror B’s data manipulation for table A. Which is the correct 0.0/ 5.0 Points
character string to be entered in the blank?
UPDATE A SET A2=1, A3=2 WHERE ……………….
A(A1, A2, A3) is the structure of table A, the underline indicates the primary key

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

A. CURRENT OF B

B. A1=B OF A

C. A1=B

D. A1=CURRENT OF B

Question 17 of 20
Which of the following statements is true concerning routines and triggers? 5.0/ 5.0 Points

A. Both consist of procedural code.

B. Both have to be called to operate.

C. Both run automatically.

D. Both are stored in the database.

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

A. BEFORE trigger.

B. BEGIN trigger.

C. INSTEAD OF trigger.

D. AFTER trigger.

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

A. BEFORE

B. SQL Server supports all three.

C. AFTER

D. INSTEAD OF

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

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

A. Scalar-valued function

B. Stored procedure

C. Table-valued function

D. DML trigger

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/index/mainIndex 6/6

You might also like