HOTSPOT - A company develops a series of mobile games. All games use a single leaderboard service. You have the following requirements: - Code must be scalable ...


Microsoft AZ-204 Exam

Questions Number: 110 out of 355 Questions
30.99%

Question 110
HOTSPOT -
A company develops a series of mobile games. All games use a single leaderboard service.
You have the following requirements:
- Code must be scalable and allow for growth.
- Each record must consist of a playerId, gameId, score, and time played.
- When users reach a new high score, the system will save the new score using the SaveScore function below.
Each game is assigned an Id based on the series title.
AZ-204_110Q_1.png related to the Microsoft AZ-204 Exam
You plan to store customer information in Azure Cosmos DB. The following data already exists in the database:
AZ-204_110Q_2.png related to the Microsoft AZ-204 Exam
You develop the following code to save scores in the data store. (Line numbers are included for reference only.)
AZ-204_110Q_3.png related to the Microsoft AZ-204 Exam
You develop the following code to query the database. (Line numbers are included for reference only.)
AZ-204_110Q_4.jpg related to the Microsoft AZ-204 Exam
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:
AZ-204_110Q_5.png related to the Microsoft AZ-204 Exam



Box 1: Yes -
Create a table.
A CloudTableClient object lets you get reference objects for tables and entities. The following code creates a CloudTableClient object and uses it to create a new
CloudTable object, which represents a table
// Retrieve storage account from connection-string.
CloudStorageAccount storageAccount =
CloudStorageAccount.parse(storageConnectionString);
// Create the table client.
CloudTableClient tableClient = storageAccount.createCloudTableClient();
// Create the table if it doesn't exist.
String tableName = "people";
CloudTable cloudTable = tableClient.getTableReference(tableName); cloudTable.createIfNotExists();
Box 2: No -
New records are inserted with TableOperation.insert. Old records are not updated.
To update old records TableOperation.insertOrReplace should be used instead.
Box 3: No -
Box 4: Yes -
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-java





Previous Questions Next Questions