<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    幸せのちから

    平凡的世界
    看似平常實崎嶇
    成如容易卻艱辛

    Oracle DDL


    -- ================================================================================
    -- oracle SQL DDL Script File
    -- ================================================================================


    -- ===============================================================================
    --
    -- Generated by: tedia2sql -- v1.2.13b2
    -- See http://tedia2sql.tigris.org/AUTHORS.html for tedia2sql author information
    --
    -- Target Database: oracle
    -- Generated at: Sat Dec 18 19:48:40 2004
    -- Input Files: TestERD.dia
    --
    -- ================================================================================



    -- Generated SQL Constraints Drop statements
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia

    drop index idx_iimd5;
    drop index idx_iiid;
    drop index idx_siiid;
    drop index idx_siips;
    drop index idx_iclidnm;
    drop index idx_uinm;
    drop index idx_uiid;
    drop index idx_uauiid;
    drop index idx_uiruid;
    drop index idx_acid;
    drop index idx_usmd5;
    alter table subImageInfo drop constraint fk_iisii ;
    alter table imageCategoryList drop constraint fk_iiicl ;
    alter table imageAttribute drop constraint fk_iiia ;
    alter table userImageRating drop constraint fk_uiuir ;
    alter table userAttribute drop constraint fk_uiua ;
    alter table userSession drop constraint fk_uius ;
    alter table imageAttribute drop constraint fk_iaac ;
    alter table userAttribute drop constraint fk_acua ;


    -- Generated Permissions Drops
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia

    revoke all on imageInfo from fmorg ;
    revoke select on imageInfo from public ;
    revoke all on subImageInfo from fmorg ;
    revoke all on imageCategoryList from fmorg ;
    revoke select on categoryNames from public ;
    revoke all on categoryNames from fmorg ;
    revoke all on imageAttribute from fmorg ;
    revoke all on userInfo from fmorg ;
    revoke all on userAttribute from fmorg ;
    revoke all on userImageRating from fmorg ;
    revoke all on attributeCategory from fmorg ;
    revoke all on userSession from fmorg ;
    revoke select on extremes from public ;
    revoke all on extremes from fmorg ;


    -- Special statements for oracle,postgres,db2:pre databases
    -- statements to do BEFORE creating
    -- the tables (schema)
    drop sequence imageInfo_id;
    create sequence imageInfo_id;


    -- Generated SQL View Drop Statements
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia

    drop view ratings_view cascade constraints ;
    drop view whorated_view cascade constraints ;
    drop view users_view cascade constraints ;


    -- Generated SQL Schema Drop statements
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia

    drop table imageInfo cascade constraints ;
    drop table subImageInfo cascade constraints ;
    drop table imageCategoryList cascade constraints ;
    drop table categoryNames cascade constraints ;
    drop table imageAttribute cascade constraints ;
    drop table userInfo cascade constraints ;
    drop table userAttribute cascade constraints ;
    drop table userImageRating cascade constraints ;
    drop table attributeCategory cascade constraints ;
    drop table userSession cascade constraints ;
    drop table extremes cascade constraints ;


    -- Generated SQL Schema
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia


    -- imageInfo
    create table imageInfo (
    id numeric (18) not null,
    insertionDate date default now() not null,
    md5sum char (32) not null,
    binaryType varchar (16) default 'jpg' null,
    name varchar (64) not null,
    locationList varchar (128) default '//imgserver.org',
    description varchar (128) null,
    constraint pk_ImageInfo primary key (id)
    ) ;

    -- subImageInfo
    create table subImageInfo (
    imageInfo_id numeric (18) not null,
    pixSize integer not null,
    constraint pk_SubImageInfo primary key (imageInfo_id,pixSize)
    ) ;

    -- imageCategoryList
    create table imageCategoryList (
    imageInfo_id numeric (18) not null,
    name varchar (32) not null,
    constraint pk_ImageCategoryList primary key (imageInfo_id,name)
    ) ;

    -- categoryNames
    create table categoryNames (
    name varchar (32) not null,
    constraint pk_CategoryNames primary key (name)
    ) ;

    -- imageAttribute
    create table imageAttribute (
    imageInfo_id numeric (18) not null,
    attributeCategory_id numeric (18) not null,
    numValue numeric (8),
    category numeric (4),
    constraint pk_ImageAttribute primary key (imageInfo_id,attributeCategory_id)
    ) ;

    -- userInfo
    create table userInfo (
    id numeric (18) not null,
    insertionDate date,
    md5sum char (32),
    birthDate date,
    gender char (1),
    name varchar (32),
    email varchar (96),
    currentCategory varchar (32),
    lastDebitDate date,
    acctBalance numeric (10,2),
    active integer,
    constraint pk_UserInfo primary key (id)
    ) ;

    -- userAttribute
    create table userAttribute (
    userInfo_id numeric (18) not null,
    attributeCategory_id numeric (18) not null,
    numValue numeric (5,4),
    constraint pk_UserAttribute primary key (userInfo_id,attributeCategory_id)
    ) ;

    -- userImageRating
    create table userImageRating (
    userInfo_id numeric (18) not null,
    imageInfo_id numeric (15) not null,
    rating integer,
    constraint pk_UserImageRating primary key (userInfo_id,imageInfo_id)
    ) ;

    -- attributeCategory
    create table attributeCategory (
    id numeric (18) not null,
    attributeDesc varchar (128),
    constraint pk_AttributeCategory primary key (id)
    ) ;

    -- userSession
    create table userSession (
    userInfo_id numeric (18) not null,
    md5sum char (32) not null,
    insertionDate date,
    expireDate date,
    ipAddress varchar (24),
    constraint pk_UserSession primary key (userInfo_id,md5sum)
    ) ;

    -- extremes
    create table extremes (
    name varchar (32) not null,
    colName varchar (64),
    minVal numeric (15),
    maxVal numeric (15),
    constraint pk_Extremes primary key (name)
    ) ;













    -- Generated SQL Views
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia


    -- ratings_view
    create view ratings_view as
    select b.name, c.md5sum, a.rating
    from userImageRating a,
    userImageRating z,
    userInfo b,
    imageInfo c
    where (((a.userInfo_id = b.id)
    and (a.imageInfo_id = c.id)
    and (a.userInfo_id = z.userInfo_id))
    and (a.userInfo_id <> z.userInfo_id))
    order by c.md5sum,b.name,a.rating
    ;

    -- whorated_view
    create view whorated_view as
    select a.name, count (*) as numRatings
    from userInfo a,
    userImageRating b
    where (a.id = b.userInfo_id)
    group by a.name
    ;

    -- users_view
    create view users_view as
    select id, birthDate, name ||'<'|| email ||'>' as whoIsThis, currentCategory, acctBalance, active
    from userInfo
    order by userInfo.name
    ;


    -- Special statements for oracle,postgres,db2:post databases
    -- statements to do AFTER creating
    -- the tables (schema)
    --drop trigger . . . .
    --create trigger . . . .


    -- Generated Permissions
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia

    grant all on imageInfo to fmorg ;
    grant select on imageInfo to public ;
    grant all on subImageInfo to fmorg ;
    grant all on imageCategoryList to fmorg ;
    grant select on categoryNames to public ;
    grant all on categoryNames to fmorg ;
    grant all on imageAttribute to fmorg ;
    grant all on userInfo to fmorg ;
    grant all on userAttribute to fmorg ;
    grant all on userImageRating to fmorg ;
    grant all on attributeCategory to fmorg ;
    grant all on userSession to fmorg ;
    grant select on extremes to public ;
    grant all on extremes to fmorg ;


    -- Generated SQL Insert statements
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia


    -- inserts for categoryNames
    insert into categoryNames values ( 'Buildings' ) ;
    insert into categoryNames values ( 'Landscapes' ) ;
    insert into categoryNames values ( 'Nudes' ) ;
    insert into categoryNames values ( 'Life Studies' ) ;
    insert into categoryNames values ( 'Portraits' ) ;
    insert into categoryNames values ( 'Abstracts' ) ;

    -- inserts for attributeCategory
    insert into attributeCategory values ( 1,'Blurriness' ) ;
    insert into attributeCategory values ( 2,'Contrastiness' ) ;
    insert into attributeCategory values ( 3,'Saturation' ) ;
    insert into attributeCategory values ( 4,'Size' ) ;
    insert into attributeCategory values ( 5,'Relevence' ) ;


    -- Generated SQL Constraints
    -- --------------------------------------------------------------------
    -- Target Database: oracle
    -- SQL Generator: tedia2sql -- v1.2.13b2
    -- Generated at: Sat Dec 18 19:48:32 2004
    -- Input Files: TestERD.dia

    create unique index idx_iimd5 on imageInfo (md5sum) ;
    create index idx_iiid on imageInfo (id) ;
    create index idx_siiid on subImageInfo (imageInfo_id) ;
    create index idx_siips on subImageInfo (pixSize) ;
    create index idx_iclidnm on imageCategoryList (imageInfo_id,name) ;
    create unique index idx_uinm on userInfo (name,md5sum) ;
    create index idx_uiid on userInfo (id) ;
    create index idx_uauiid on userAttribute (userInfo_id) ;
    create index idx_uiruid on userImageRating (userInfo_id) ;
    create index idx_acid on attributeCategory (id) ;
    create index idx_usmd5 on userSession (md5sum) ;
    alter table subImageInfo add constraint fk_iisii
    foreign key (imageInfo_id)
    references imageInfo (id) ;
    alter table imageCategoryList add constraint fk_iiicl
    foreign key (imageinfo_id)
    references imageInfo (id) ;
    alter table imageAttribute add constraint fk_iiia
    foreign key (imageInfo_id)
    references imageInfo (id) ;
    alter table userImageRating add constraint fk_uiuir
    foreign key (userInfo_id)
    references userInfo (id) on delete cascade ;
    alter table userAttribute add constraint fk_uiua
    foreign key (userInfo_id)
    references userInfo (id) on delete cascade ;
    alter table userSession add constraint fk_uius
    foreign key (userInfo_id)
    references userInfo (id) on delete cascade ;
    alter table imageAttribute add constraint fk_iaac
    foreign key (attributeCategory_id)
    references attributeCategory (id) ;
    alter table userAttribute add constraint fk_acua
    foreign key (attributeCategory_id)
    references attributeCategory (id) ;

    -- oracle requires a special 'quit' command
    quit

    posted on 2008-11-12 14:14 Lucky 閱讀(535) 評論(0)  編輯  收藏 所屬分類: Database

    <2008年11月>
    2627282930311
    2345678
    9101112131415
    16171819202122
    23242526272829
    30123456

    導航

    隨筆分類(125)

    文章分類(5)

    日本語

    搜索

    積分與排名

    最新隨筆

    最新評論

    主站蜘蛛池模板: 亚洲不卡av不卡一区二区| 久久免费美女视频| 亚洲mv国产精品mv日本mv| 2022中文字字幕久亚洲| 永久黄网站色视频免费观看| 蜜桃成人无码区免费视频网站| 一进一出60分钟免费视频| 亚洲av无码专区青青草原| 亚洲一区二区三区免费观看| 亚洲αv在线精品糸列| 亚洲综合国产精品第一页| 国产成人精品免费视频软件| 无人在线观看免费高清视频| 免费无遮挡无码永久视频| 国产免费阿v精品视频网址| 乱人伦中文视频在线观看免费| 亚洲精品无码专区| 亚洲午夜无码毛片av久久京东热| 亚洲视频在线免费播放| 亚洲av日韩av高潮潮喷无码 | 97精品免费视频| 人禽伦免费交视频播放| 亚洲av永久无码精品秋霞电影秋 | 国产成人免费视频| 久久国产精品免费一区二区三区| 羞羞漫画登录页面免费| 亚洲精品无码成人片久久不卡| 亚洲另类精品xxxx人妖| 亚洲成a人片在线观| 亚洲系列国产精品制服丝袜第| 亚洲av午夜福利精品一区人妖| 亚洲精品午夜国产VA久久成人| 77777亚洲午夜久久多人| 亚洲色欲久久久综合网| 亚洲人色婷婷成人网站在线观看| 亚洲人成色7777在线观看不卡| 亚洲国产香蕉人人爽成AV片久久| 免费又黄又硬又爽大片| 国产啪亚洲国产精品无码 | 久久成人无码国产免费播放| 久久免费线看线看|