專注應(yīng)用,關(guān)注發(fā)展,開拓創(chuàng)新

          <-------------------------------------------------------------------& 珍惜生命 . 善用時(shí)間 . 把握未來 . 創(chuàng)造價(jià)值。

          BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
            11 Posts :: 17 Stories :: 10 Comments :: 0 Trackbacks
          2.2數(shù)據(jù)庫結(jié)構(gòu)
          在這個tiny的系統(tǒng)中,數(shù)據(jù)庫有3個表tb_employee(職員表),tb_time(時(shí)間表),tb_salary(薪酬表)。表結(jié)構(gòu)如下:
          drop table tb_employee;
          create table tb_employee
          (
          employee_id number, --職員id
          employee_name varchar2(10) --職員姓名
          );
          drop table tb_time;
          create table tb_time
          (
          time_id number, --時(shí)間id
          the_year char(4), --年
          the_month char(2) --月
          );

          drop table tb_salary;
          create table tb_salary
          (
          employee_id number, --職員id
          time_id number, --時(shí)間id
          salary number(19,4) --薪酬
          );
          當(dāng)然,為了使系統(tǒng)能夠運(yùn)行,還需要讀者向數(shù)據(jù)庫表中插入一些數(shù)據(jù)。
          2.3根據(jù)數(shù)據(jù)庫表的結(jié)構(gòu),書寫schema文件
          <?xml version="1.0"?>
          <Schema name="Mondrian">
          <Cube name="CubeTest">
          <Table name="TB_SALARY" />
          <Dimension name="Employee" foreignKey="EMPLOYEE_ID" >
          <Hierarchy hasAll="true" primaryKey="EMPLOYEE_ID">
          <Table name="TB_EMPLOYEE" />
          <Level name="employeeId" column="EMPLOYEE_ID" uniqueMembers="true" >
          <Property name="employeeName" column="EMPLOYEE_NAME"/>
          </Level>
          </Hierarchy>
          </Dimension>
          <Dimension name="Time" foreignKey="TIME_ID" >
          <Hierarchy hasAll="false" primaryKey="TIME_ID" >
          <Table name="TB_TIME" />
          <Level name="year" column="THE_YEAR" uniqueMembers="false" />
          <Level name="month" column="THE_MONTH" uniqueMembers="false" />
          </Hierarchy>
          </Dimension>
          <Measure name="Salary" column="SALARY" aggregator="sum" />
          </Cube>
          </Schema>
          posted on 2006-05-05 14:25 吳名居 閱讀(249) 評論(0)  編輯  收藏 所屬分類: 數(shù)庫倉庫-mondrian

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 峨山| 漯河市| 云和县| 成都市| 蓬莱市| 泾阳县| 沁源县| 德化县| 通城县| 从化市| 建始县| 县级市| 阿克苏市| 和政县| 淳化县| 南丹县| 许昌市| 茶陵县| 寻乌县| 迁西县| 陆川县| 彭泽县| 肥乡县| 潼南县| 忻州市| 马山县| 迁安市| 青岛市| 新巴尔虎左旗| 马龙县| 克拉玛依市| 同德县| 敖汉旗| 沅陵县| 青龙| 于田县| 务川| 乌什县| 府谷县| 噶尔县| 怀集县|