开始使用免费开始使用

在 Table storage 中插入并查询数据

Cipher Coffee 想为其会员计划存储简单的结构化数据,而不希望维护一整套数据库的开销。您的任务是使用 Azure Table Storage 创建一个表,插入示例会员实体,并运行查询以高效检索客户记录。 您将使用不同的 PartitionKey 和 RowKey 插入实体,然后按 PartitionKey 查询以验证快速查找。

本练习是课程的一部分

面向 Azure Storage 的开发

查看课程

练习说明

在您的 Storage account 中,打开 Data storageTables,创建名为 "LoyaltyProfiles" 的表。,插入两个实体,它们共用 PartitionKey "CustomerA",并使用不同的 RowKey 值 "1001" 和 "1002"。,再插入第三个实体,使用 PartitionKey "VIP" 和 RowKey "2001"。,使用筛选器 PartitionKey eq 'CustomerA' 查询该表,只返回两个 "CustomerA" 实体。 Screenshot showing the Azure Portal *Tables* view with a table named LoyaltyProfiles, the Add entity panel, and a query input filtering by PartitionKey.

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习