Microsoft Developing SQL Databases (70-762日本語版) - 70-762日本語 Exam Practice Test

Question 1
Microsoft Azure SQLデータベースがあります。 データベースに対してQuery Storeを有効にし、以下の設定を使用するようにストアを構成します。
SIZE_BASE_CLEANUP_MODE= OFF
STATE_QUERY_THRESHOLD_DAYS =60
MAX_STORAGE_SIZE= 100
QURRY_CAPTURE _MODE =ALL
Azureパフォーマンスインサイトを使用してクエリを受け取ります。 あなたは、新しいクエリが後に表示されないことを観察します
15日、そのQUEYストアを読み取り専用モードに設定します。
クエリストアのデータペースが不足している場合、ストアは定期的なクエリまたは重要なリソースを消費するクエリから優先順位を付ける必要があります。
クエリストアをread_writeモードに設定し、過去60日間のクエリのパフォーマンスを確認します。
どの3つのステートメントを実行しますか? 正しい各ステップは解決策の一部を表しています。
注:各選択は1ポイントの価値があります。

Correct Answer: B,C,E
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 2
Microsoft Azure SQL Databaseインスタンスを管理します。
User 1に、dboスキーマ内のすべてのオブジェクトに対するSELECT権限とEXECUTE権限を付与します。
User1が次の情報を表示するのを許可するストアドプロシージャを作成する必要があります。
* データベースへの各接続の詳細
* すべてのアクティブなユーザー接続と内部タスクのリスト
User1のストアドプロシージャを作成し、User1がエラーなしでストアドプロシージャを実行できることを確認する必要があります。
Transact-SQLステートメントをどのように完成させるべきですか? 回答するには、適切なTransact-SQLセグメントを正しい場所にドラッグします。 各Transact-SQLセグメントは、1回、複数回、またはまったく使用しないことができます。 コンテンツを表示するには、ペイン間の分割バーをドラッグするか、スクロールする必要があります。
注:回答の選択肢の複数の組み合わせが正しいです。 あなたが選択した正しい組み合わせのいずれかのためのクレジットを受け取ります。
Correct Answer:

Explanation

Box 1: Sys.dm_exec_connections
Sys.dm_exec_connections returns information about the connections established to this instance of SQL Server and the details of each connection. Returns server wide connection information for SQL Server.
Returns current database connection information for SQL Database.
Box 2: sys.dm_exec_sessions
sys.dm_exec_sessions returns one row per authenticated session on SQL Server. sys.dm_exec_sessions is a server-scope view that shows information about all active user connections and internal tasks.
Box 3: GRANT VIEW DATABASE STATE To User1
SQL Database: Requires VIEW DATABASE STATE to see all connections to the current database. VIEW DATABASE STATE cannot be granted in the master database.
Question 3
次のTransact-SQLステートメントを実行します。

レコードは、ビューを使用してのみordersテーブルに追加する必要があります。顧客名が存在しない場合は、新しい顧客名を作成する必要があります。
ビューを使用してordersテーブルに行を挿入できることを確認する必要があります。
あなたは何をするべきか?

Correct Answer: D
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 4
完了するのに長い時間がかかる複数のクエリがあります。
クエリ内のTransact-SQLステートメントに関する詳細情報を使用して、原因を特定する必要があります。 Transact-SQLステートメントは、分析の一部として実行しないでください。
どのTransact-SQLステートメントを実行する必要がありますか?

Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 5
Microsoft Azure SQLデータベースがあります。
クエリによっては実行に時間がかかるものがあります。
長期実行クエリによって、ユーザーがデータベース内のデータを更新できないようにするかどうかを識別する必要があります。
どのクエリを実行しますか? 回答するには、回答領域で適切なオプションを選択します。
注:それぞれ正しい選択は1ポイントの価値があります。
Correct Answer:

Explanation

Box 1: sys.dm_tran_locks
sys.dm_tran_locks returns information about currently active lock manager resources in SQL Server 2017.
Each row represents a currently active request to the lock manager for a lock that has been granted or is waiting to be granted.
Box 2: sys.dm_os_waiting_tasks
sys.dm_tran_locks.lock_owner_address is the memory address of the internal data structure that is used to track this request. This column can be joined the with resource_address column in sys.dm_os_waiting_tasks.
References:
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-tran-locks
Question 6
注:質問は、同じまたは類似の回答の選択肢を使用する一連の質問の一部です。回答の選択は、シリーズ内の複数の質問に対して正しい場合があります。各質問はシリーズの他の質問から独立しています。質問に記載されている情報と詳細は、その質問にのみ適用されます。
データベースDB1があります。データベースはメモリ最適化ファイルグループを使用しません。データベースにはTable1という名前のテーブルが含まれています。テーブルは以下のワークロードをサポートする必要があります。

既存のReportingクエリのパフォーマンスを低下させずに、新しいOLTPワークロードをサポートするための最も効率的なインデックスを追加する必要があります。
あなたは何をするべきか?

Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 7
注:この質問は同じシナリオを使用する一連の質問の一部です。 あなたの便宜のために、シナリオは各質問で繰り返されます。 各質問はそれぞれ異なる目標と答えの選択を提示しますが、シナリオの本文はこのシリーズの各質問でまったく同じです。
BlogCategory、BlogEntry、ProductReview、Product、およびSalesPersonの各テーブルを含むデータベースがあります。 テーブルは、次のTransact SQLステートメントを使用して作成されました。

以下の要件を満たすようにProductReviewテーブルを変更する必要があります。
* テーブルはProductテーブルのProductID列を参照する必要があります
* ProductReviewテーブル内の既存のレコードはProductテーブルで検証してはいけません。
* レコードがProductReviewテーブルによって参照されている場合、Productテーブル内のレコードの削除は許可されません。
* Productテーブル内のレコードへの変更はProductReviewテーブルに伝播する必要があります。
次のデータベーステーブルもあります:Order、ProductTypes、およびSalesHistory、これらのテーブルのtransactions-SQLステートメントは使用できません。
以下の要件を満たすようにOrdersテーブルを変更する必要があります。
* テーブルにINSERT権限を付与せずにテーブルに新しい行を作成します。
* 注文が完了したかどうかを注文を出した販売員に通知してください。
SalesHistoryテーブルに次の制約を追加する必要があります。
* フィールドをレコード識別子として使用できるようにするSaleID列の制約
* ProductTypesテーブルのProduct列を参照するためにProductID列を使用する定数
* 列にNULL値を持つ1行を許可するCategoryID列に対する制約
* SalePrice列を4人を超える財務部門ユーザーの値に制限する制約は、SalesYTD列の値が特定のしきい値を超える営業担当者のSalesHistoryテーブルからデータを取得できる必要があります。
SalesOrderという名前のメモリ最適化テーブルを作成する予定です。 テーブルは以下の要件を満たす必要があります。
* テーブルには1000万のユニークな受注がなければなりません。
* テーブルは、I / O操作を最小限に抑えるためにチェックポイントを使用しなければならず、トランザクションロギングを使用してはいけません。
* データ損失は許容範囲内です。
完全等価操作を使用してWhere句を使用するSalesOrderテーブルに対するクエリのパフォーマンスを最適化する必要があります。
ProductReviewテーブルの参照整合性を有効にする必要があります。
関連するTransact-SQLステートメントをどのように完成させるべきですか? 答える? 回答領域で適切なTransact-SQLセグメントを選択します。
Correct Answer:

Explanation

Box 1: WITH NOCHECK
We should use WITH NOCHECK as existing records in the ProductReview table must not be validated with the Product table.
Box 2: ON DELETE NO ACTION ON DELETE NO CASCADE
Deletes should not be allowed, so we use ON DELETE NO ACTION.
Updates should be allowed, so we use ON DELETE NO CASCADE
NO ACTION: the Database Engine raises an error, and the update action on the row in the parent table is rolled back.
CASCADE: corresponding rows are updated in the referencing table when that row is updated in the parent table.
Note: ON DELETE { NO ACTION | CASCADE | SET NULL | SET DEFAULT }
Specifies what action happens to rows in the table that is altered, if those rows have a referential relationship and the referenced row is deleted from the parent table. The default is NO ACTION.
ON UPDATE { NO ACTION | CASCADE | SET NULL | SET DEFAULT }
Specifies what action happens to rows in the table altered when those rows have a referential relationship and the referenced row is updated in the parent table. The default is NO ACTION.
Note: You must modify the ProductReview Table to meet the following requirements:
* The table must reference the ProductID column in the Product table
* Existing records in the ProductReview table must not be validated with the Product table.
* Deleting records in the Product table must not be allowed if records are referenced by the ProductReview table.
* Changes to records in the Product table must propagate to the ProductReview table.
References: https://msdn.microsoft.com/en-us/library/ms190273.aspx
https://msdn.microsoft.com/en-us/library/ms188066.aspx
Question 8
Customerという名前のメモリ最適化テーブルがあります。 テーブルは、ManageCustomerという名前のストアドプロシージャによってアクセスされます。
データベースはMicrosoft SQL Server 2014で作成されました。データベースをSQL Server 2016に移動するために、バックアップおよび復元操作が使用されました。
ストアドプロシージャのパフォーマンスの問題があります。
パフォーマンスの問題を解決し、テーブル統計が自動的に更新されるようにする必要があります。
ソリューションを開発するには、どの3つのTransact-SQLセグメントを使用する必要がありますか? 回答するには、適切なTransact-SQLセグメントをTransact-SQLセグメントのリストから回答エリアに移動し、正しい順序に並べます。
Correct Answer:

Explanation

Step 1: ALTER DATABASE CURRENT SET COMPATIBILITY_LEVEL
Sets certain database behaviors to be compatible with the specified version of SQL Server.
Syntax:
ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL = { 150 | 140 | 130 | 120 | 110 | 100 | 90 }
Step 2: UPDATE STATISTICS Customers
UPDATE STATISTICS updates query optimization statistics on a table or indexed view.
Step 3: EXEC sp_recompile N' 'Manage_customer'
sp_recompile causes stored procedures, triggers, and user-defined functions to be recompiled the next time that they are run. It does this by dropping the existing plan from the procedure cache forcing a new plan to be created the next time that the procedure or trigger is run References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level
https://docs.microsoft.com/en-us/sql/t-sql/statements/update-statistics-transact-sql
Question 9
注:この質問は、同じまたは類似の回答の選択肢を使用する一連の質問の一部です。 回答の選択は、シリーズ内の複数の質問に対して正しい場合があります。 各質問は、このシリーズの他の質問から独立しています。
質問で提供される情報と詳細は、その質問にのみ適用されます。
次のテーブルを含むDB1という名前のMicrosoft SQL Serverデータベースがあります。

TBL1とTBL2の間に外部キーの関係はありません。
両方のテーブルのデータを含むクエリを作成し、クエリがデータを返すのに必要な時間を最小限に抑える必要があります。
あなたは何をするべきか?

Correct Answer: G
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 10
Salesという名前のデータベースがあります。
次の表に示す列を含むCustomerという名前の表を作成する必要があります。

どのようにTransact SQLステートメントを完成させるべきですか? 回答するには、回答領域で適切なTransact-SQLセグメントを選択します。
Correct Answer:

Explanation

Box 1: MASKED WITH (FUNCTION ='default()')
The Defualt masking method provides full masking according to the data types of the designated fields.
Example column definition syntax: Phone# varchar(12) MASKED WITH (FUNCTION = 'default()') NULL Box 2: MASKED WITH (FUNCTION ='partial(3,"XXXXXX",0)') The Custom String Masking method exposes the first and last letters and adds a custom padding string in the middle. prefix,[padding],suffix examples:
PhoneNumber varchar(10) MASKED WITH (FUNCTION = 'partial(5,"XXXXXXX",0)') Box 3: MASKED WITH (FUNCTION ='email()') The Email masking method which exposes the first letter of an email address and the constant suffix ".com", in the form of an email address. [email protected].
Example definition syntax: Email varchar(100) MASKEDWITH (FUNCTION = 'email()') NULL References: https://msdn.microsoft.com/en-us/library/mt130841.aspx
Question 11
次の2つのストアドプロシージャを作成しています。
* ネイティブにコンパイルされたストアドプロシージャ
* ディスクベーステーブルとメモリ最適化テーブルの両方にアクセスするインタプリタストアドプロシージャ両方のストアドプロシージャはトランザクション内で実行されます。
クロスコンテナ取引が可能であることを確認する必要があります。
どの設定またはオプションを使用しますか?

Correct Answer: A
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).