第…­ç«  RDBMS 焉©±•

  • View
    63

  • Download
    0

Embed Size (px)

DESCRIPTION

第六章 RDBMS 的扩展. 关系模型中概括与聚合的扩展 支持共享与递归的分子对象概念 关系查询语言 QUEL 的扩展及其支持 关系模型中的抽象数据类型 XSQL 语言的扩展 嵌套的关系模型 NF2. ※6.1 关系模型中概括与聚集的扩展. 例 1 :关于人的特化模型示例. Persons. maritalStatus. nationality. sex. Singles. Austrians. Females. …. Canadians. Married. Males. 关系扩展模型 —— 一般化的 m 维特化示例. R. S km. - PowerPoint PPT Presentation

Text of 第…­ç«  RDBMS...

  • RDBMSQUELXSQLNF2

  • 6.1 1

    PersonssexmaritalStatusnationalityFemalesAustriansCanadiansSinglesMalesMarried

  • mRSk1SkmR11R1p1Rm1Rmpm

  • var R : generic sk1=(R11,,R1p1); skm=(Rm1,,Rmpm); of aggregate keylist s1: key R1; sn: key Rn; end

  • genericRn generickeyRmsk1skmskiRpiR

  • RmRmRPiRi1,,Ripi)Msk1,,skmR s1,,sn

  • genericRRnRi1in (1)key Ri (2)generickey,Keylist{s1,,sn}

  • Rij1im1jPigenericRcopySki1imRSj 1jnSkiSjSjRjRi1,,Ripi

  • CSGP31CSG ::= ::= | | ::= cube | cylinder | cone | ::= rotate | scale | translate | ::= union | intersection |difference |

  • object 1. Prim_obj 2. Mot_obj 3. Comp_obj

  • CSGMech_objIDMANARG_OBJLEFT_ARGRIGHT_ARGTYPEMot_objPrim_objComp_objTMATPRICEOP_CODEPTYPEcylindercuboidLENGTHWIDTHHEIGHT

  • CSG (1) var mech_obj: generic (2) TYPE = (prim_obj, mot_obj, comp_obj); (3) of (4) aggregate [ID] (5) ID : identifier; (6) MAN: manufacturer; (7) TYPE: structural_comp (8) end

  • Mech_obj var prim_objgeneric prim_obj mech_obj PTYPE =(cylinder,,cuboid); of PTYPE aggregate[ID] ID:identifier; MAN:manufacturer; TYPE MAT:material; PRICE:money; PTYPE:geom_form; end

  • var cuboid cuboidgeneric aggregate [ID] ID:identifier; MAN:manufacturer; MATmaterial; PRICE:money; LENGTH:real; cuboid WIDTH:real; HEIGHT:real; end

  • var mot_obj mot_objgeneric aggregate [ID] ID:identifier; MAN:manufacturer; ARG_OBJ: key mech_obj; T : matrix; end

  • var comp_obj aggregate [ID] ID:identifier; MAN:manufacturer; LEFT_ARG_OBJ:key mech_obj; RIGHT_ARG_OBJ: key mech_obj; OP_CODE :( union,difference,intersection,) end

  • bracketCSG

    mech_obj

    ID MAN TYPE bracket #1plate #1plate #2 Steal,Inc.Steal,Inc.Steal,Inc. comp_objprim_objprim_obj

  • comp_obj

    ID MANLEFT_ARG_OBJRIGHT_ARG_OBJOP_CODE bracket #1 steal,Inc. plate#1 plate #2 union

    prim_obj

    ID MAN MAT PRICE PTYPE plate #1plate #2 steal,Inc.steal,Inc. ironiron 20.0010.00 cuboidcuboid

  • cuboid

    IDMANMATPRICELENGTHWIDTHHEIGHTplate #1plate #2 steal,Inc.steal,Inc. ironiron 20.0010.00 10 10 5 2 0.5 0.5

  • 1. , 2.1. 2. 3. 4.

  • 6.2 generic(Molecular Object ()

  • / / / / /

  • /

  • /

  • / CSG 3.2

  • / CSG DAG

  • CSG1CSG2

  • 6.3 QUELQUEL:Ingres QUELrange offromrange of t is r(tr)retrieveselectrangeretrive t.AtAwhere PP*

  • E-R

    mechanical_partIDNAMEcube#1cube#2cube#3

  • QUELrange of m is mechanical_partrange of f is facesrange of b is boundaryretrive m.all,f.allwhere m.ID = cube#1 and m.ID = b.GEO_IDand f.ID = b.FACE_ID

    range of m is mechanical_partretrive m.all, m.FACE_JOINwhere m.ID = cube#1

    range of f is facesretrive f.GEO_JOINwhere f.ID= f1

  • QUELQUELQUELQUELboundary

  • facesIDSURFACEGEO_JOINf1

    f2f610.0

    15.0

    range of m is mechanical_part retrieve m.all where m.ID in {cube#1, cube#2}

  • QUELmech-partFACE-JOINfacesGEO-JOINrange of m is mech-partretrieve m.all,m.FACE-JOINwhere m.ID = cube#1

    range of f is facesretrieve f.GEO-JOINwhere f.ID=f1

  • range of m is mech-partretrive m.FACE-JOIN.SURFACEwhere m.ID = cube#1QUEL.

  • (QUEL)

  • ()range of m is mechanical_partretrive sum(m.FACE-JOIN.SURFACE)where m.ID = cube#1

    range of m is mechanical_partretrive sum(m.FACE_JOIN.SURFACE)where m.ID = cube#3

  • 6.4 INGRESCADT-INGRESPOSTGRES

  • ADTcuboids ( id: integer, material: char(10), description: char(20), V1: ADT: vertex_type, V2: ADT: vertex_type, V8: ADT: vertex_type)

  • ()ADTdefine ADT(typename = vertex_type, bytesin = 9, bytesout = 9, inputfunc = to_internal_vertex, outputfunc = to_external_vertex, filename = /usr/ingres//vertex)XYZX%%Y%%Zto_internal_vertexto_external_vertex

  • ()C(informixjava)ADTADT

  • range of c is cuboidsretrieve (c.material, c.description,c.V1)where c.id = 5

  • ADTinformixUDRdefine adtop(opname = Ry, funcname = rotate_abount_y, filename = /usr/ingres/../rotate_y, result = ADT: vertex_type, arg1 = ADT: vertex_type, arg2 = ADT: angle_type, prec like +)

  • 6.5 XSQLXSQLKifer1992SQLSQL-3SQLXSQL

  • XSQL SurrogatesDBprocessor IDdate & time

  • component of XSQLpart-ofcomponent-of1:11:NE-R

    create table E1(E1-ID:identifier, E1_DATA:)create table E2(E2-ID:identifier, E2_FATHER:component of (E1), E2_DATA:)component of E2e2R1E1e1IDN1

  • create table E1(E1-ID:identifier, E1_DATA:)create table E2(E2-ID:identifier, E2_FATHER:component of (E1), E2_DATA:)

  • IDmapTIDs

    E2E2-IDE2-FATHERE2-DATA$589000101$589000103$589000100$589000100

    E3E3-IDE3-FATHERE3-DATA$589000102$589000104$589000100$589000100

    E4E4-IDE4-FATHERE4-DATA$589000105$589000101

    E1E1-IDE1-DATA$589000100$589000200

  • N:MXSQLN:MRreference

  • N:ME-R

    create table E1(E1-ID:identifier, E1_DATA:)create table E1(E2-ID:identifier, E2_DATA:)create table R(R-ID:identifier,RtoE1: reference(E1),RtoE2: reference(E2))

  • XSQLQUELcomponent-of1:N

  • ()referenceJOINmap(clustering)()