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. You plan to store customer information in Azure Cosmos DB. The following data already exists in the database: You develop the following code to save scores in the data store. (Line numbers are included for reference only.) You develop the following code to query the database. (Line numbers are included for reference only.) 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: Suggested Answer: 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 This question is in AZ-204: Developing Solutions for Microsoft Azure Exam For getting Microsoft Azure Developer Associate Certificate Disclaimers: The website is not related to, affiliated with, endorsed or authorized by Microsoft. The website does not contain actual questions and answers from Microsoft's Certification Exams. Trademarks, certification & product names are used for reference only and belong to Microsoft.
Please login or Register to submit your answer