Topic 1 Question 56
You are designing a schema for a Cloud Spanner customer database. You want to store a phone number array field in a customer table. You also want to allow users to search customers by phone number. How should you design this schema?
Create a table named Customers. Add an Array field in a table that will hold phone numbers for the customer.
Create a table named Customers. Create a table named Phones. Add a CustomerId field in the Phones table to find the CustomerId from a phone number.
Create a table named Customers. Add an Array field in a table that will hold phone numbers for the customer. Create a secondary index on the Array field.
Create a table named Customers as a parent table. Create a table named Phones, and interleave this table into the Customer table. Create an index on the phone number field in the Phones table.
ユーザの投票
コメント(10)
i vote D since it said 'interleave'
👍 12dendut2021/01/13Correct answer is C, as in the question states: "You want to store a phone number array field in a customer table". So... adding the phone number as array field and adding a secondary index should be the best option in this case.
👍 7fosky942021/04/18https://cloud.google.com/spanner/docs/data-types -->can't set secondary index in array so I vote D
👍 4yuchun2021/06/22
シャッフルモード