0

我有以下结构,我想将其转换为表( RDBMS )。

1)
Structure(
      // 1st entry
      "HK"
      Structure(
      "Aggressive Price", 100
      "Passive Price",    90,
      "Quantity", 1000
      "Tick Ladder", [ [ 0.1, 1 ],
                       [ 0.2, 2 ],
                       [ 0.3, 3 ] 
                     ]
      ),                  
     //2nd entry
     "JP",
      Structure(
      "Aggressive Price", 100
      "Passive Price",    90,
      "Quantity", 1000
      "Tick Ladder", [ [ 0.1, 1 ],
                       [ 0.2, 2 ],
                       [ 0.3, 3 ] 
                     ],
      Aggressive limits, Structure( "ABC", 10, "SCD", 20 )
      )         
)         

2)
Structure(
      // 1st entry
      "Algo1"
      Structure(
      "Aggressive Price", 100
      "Passive Price",    90,
      "Quantity", 1000
      "Tick Ladder", [ [ 0.1, 1 ],
                       [ 0.2, 2 ],
                       [ 0.3, 3 ] 
                     ]
      ),                  
     //Second entry
     "JP",
      Structure(
      "Aggressive Price", 100
      "Passive Price",    90,
      "Quantity", 1000
      "Tick Ladder", [ [ 0.1, 1 ],
                       [ 0.2, 2 ],
                       [ 0.3, 3 ] 
                     ],
      Aggressive limits, Structure( "ABC", 10, "SCD", 20 )
      )         
)         

Structure(
      // 1st entry
      "Algo2"
      Structure(
      "Aggressive Price", 100
      "Passive Price",    90,
      "Quantity", 1000
      "Tick Ladder", [ [ 0.1, 1 ],
                       [ 0.2, 2 ],
                       [ 0.3, 3 ] 
                     ]
      ),                  
     //Second entry
     "JP",
      Structure(
      "Aggressive Price", 100
      "Passive Price",    90,
      "Quantity", 1000
      "Tick Ladder", [ [ 0.1, 1 ],
                       [ 0.2, 2 ],
                       [ 0.3, 3 ] 
                     ],
      Aggressive limits, Structure( "ABC", 10, "SCD", 20 )
      )         
)         

1) -- 包含国家“HK”和“JP”的参数。

2) -- 包含“Algo1”和“Algo2”的相同参数。参数的值可以变化。将其表示为关系模式的最佳方式是什么。

我正在考虑的解决方案

1) 带有激进价格、被动价格、数量、刻度阶梯的“参数”表

2)引用表参数的表“国家”

3) 引用表参数的表“算法”

4) 一个表“梯形图”,用于存储将由“参数”数组引用的梯形图值。

如何为引用“参数”等的“国家”表生成唯一键?

还有其他更好的方法吗?

4

1 回答 1

0

这样的事情是不是很离谱?

create table countries (country_code char(2) primary key,
                        country longtext);

create table algos (pk char(40) primary key,
                    country_code_fk char(2),
                    aggressive_price decimal(8,2),
                    passive_price decimal(8,2),
                    quantity int,
                    tick_ladder enum);

create table aggressive_limits (algo_fk char(40),
                                field_0 char(3),
                                field_1 int,
                                field_2 char(3),
                                field_3 int);
于 2012-12-14T00:45:11.120 回答