繁体   English   中英

Android应用程序的数据库设计

[英]Database Design For android Application

我想创建一个销售Android应用程序的在线产品。 我需要维护产品及其类别的数据库,如下所示。

 1. category
 2. subcategories
 3. sub subcategories

n个级别类别。 我还想保持Google Play像应用程序评级数据库一样的功能。
我应该如何设计数据库?

Google Play的类别和产品的结构类似于以下内容:

Apps
    Games
        Arcade & Action
            Flying Simulator
            Ingress
        Brain & Puzzle
            The Room
            The Room Two
            Where's My Water?
            Cut the Rope
    Business
        OfficeSuite Por 7
        Docs To Go Premium Key
Books
    Arts & Entertainment
        Art
            Wuthering Heights

创建以下内容:

Table: category
Columns: category_id, category_name, parent_category_id

Table: product
Columns: product_id, product_name

Table: category_product
Columns: category_product_id, product_id, category_id

并按如下所示插入数据:

类别表:

1, Apps, null
2, Games, 1
3, Arcade & Action, 2
4, Brain & Puzzle, 2
5, Business, 1
7, Books, null
8, Arts & Entertainment, 7
9, Art, 8

产品表:

100, Flying Simulator
101, Ingress
102, The Room
103, The Room Two
104, Where's My Water?
105, Cut the Rope
106, OfficeSuite Por 7
107, Docs To Go Premium Key
108, Wuthering Heights

category_product:

1000, 100, 3
1001, 101, 3
1002, 102, 4
1003, 103, 4
1004, 104, 4
1005, 105, 4
1006, 106, 5
1007, 107, 5
1008, 108, 9

您可以对评级进行相同的操作。 创建一个product_rating表。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM