【问题标题】:create database for android application为android应用程序创建数据库
【发布时间】:2013-02-12 22:00:09
【问题描述】:

我正在开发一个 android 应用程序,它可以帮助公众获取有关孟买公交路线的信息。

我面临一个问题,我应该如何创建一个数据库(设计),以便当用户输入源站和目的地站时,它应该返回该路线的相应巴士号码。 大约有 2000 个巴士站和 750 辆巴士在运行,......

我有 .csv 文件中的所有数据..就像每辆公共汽车的整个路线一样..但我仍然对我应该如何去做感到困惑...

【问题讨论】:

    标签: android database


    【解决方案1】:

    你可以喜欢

     Bus_details:
       bus_id
       other_bus _details
       .....
     station_details:
        station_id
        station
        ....
     route_details:
       route_id 
       route (stationid1,stationid2,...,stationidn) //separated by character
    
     schedule_details:
       Bus_id
       route_id
       day
       month
       time
    

    你也可以有车站之间的距离和时间

    【讨论】:

    • 如果我想查找在特定巴士站之间运行的所有巴士,我将如何发起查询。 (只有基本到中级的 sql 知识).. (stationid1,stationid2...) 对我来说是一个令人困惑的部分......
    • 我不是数据库专家 :),但这应该可以,'select bus_id,schedule.route_id from schedule join route_details on schedule.route_id = route_details.route_id where route_details.route like '%stationid1,stationid2 %'; .... 我的意思是,我们可以使用 'like' 运算符获取结果。
    • ohhhh..我会试试这个并明确回复,..非常感谢您的帮助
    • k.最好的.. 你也可以有任何组合,例如,路线是 'st6,st7,st8,st9,st10' 然后如果你想找到公共汽车 bet'n 说 st7 和 st9,只需像 '%st7%,st9 % 这将给出结果。你也看看link。 /index.htm
    猜你喜欢
    • 1970-01-01
    • 2018-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-16
    • 2014-04-02
    相关资源
    最近更新 更多