資料庫原理實驗一建模工具的使用

2022-12-26 23:15:03 字數 2865 閱讀 9084

《資料庫原理》實驗報告

一、 實驗目的:

1、使用qdesigner或其他建模工具完成本實驗;

2、完成下列表中所描述資料庫的概念資料模型設計,對關鍵字、空值、域完整性等做出必要的描述,根據實際情況確定聯絡的型別;

3、依據所涉及的概念資料模型生成相應的物理資料模型,可以對生成德物理資料模型作必要的修改;

4、生成建立資料庫的目標**。

二、 實驗使用環境:

sql server 2005、qdesigner或powerdesigner

三、 實驗內容與完成情況:

1. 建立實驗指導書所示訂單管理資料庫中的4個表,同時完成資料完整性的定義(實體完整性、參照完整性和使用者定義的域完整性)。

2. 要求在powerdesigner下完成關係圖,並將建好的關係圖匯入sql server 2005中新建的資料庫(訂單管理資料庫)中,分析總結powerdesigner工具中列的約束是如何設定的?

3. 將生成的關係圖產生報表(report)。

4. 將四張表自動轉換為oracleg10g的sql**,分析對比這兩個dbms在**上有什麼不同點。

實驗完成情況

1.2. 3.

4./* dbms name: oracle version 10g

/* created on: 2014/4/25 22:25:48

alter table "order_detail"

drop constraint fk_order_de_reference_order_ta;

alter table "order_detail"

drop constraint fk_order_de_reference_product;

alter table "order_table"

drop constraint fk_order_ta_reference_customer;

drop table "customer" cascade constraints;

drop table "order_detail" cascade constraints;

drop table "order_table" cascade constraints;

drop table "product" cascade constraints;

/* table: "customer

create table "customer" (

"cus_nochar(8not null,

"cus_namenvarchar2(40not null,

"linkmannchar(10),

"addressnvarchar2(40),

"postcodechar(6),

"telephonechar(12),

"emailvarchar2(30),

constraint pk_customer primary key ("cus_no")

);/* table: "order_detail

create table "order_detail" (

"order_nochar(8not null,

"nosmallint,

"pro_nochar(8not null,

"ord_order_no" char(10),

"numbersmallint,

constraint pk_order_detail primary key ("order_no", "pro_no")

);/* table: "order_table

create table "order_table" (

"cus_nochar(8),

"order_nochar(10not null,

"order_timedate,

constraint pk_order_table primary key ("order_no")

);/* table: "product

create table "product" (

"pro_nochar(8not null,

"pro_namenvarchar2(40),

"standardnchar(40),

"pricenumber(8,2),

constraint pk_product primary key ("pro_no")

);alter table "order_detail"

add constraint fk_order_de_reference_order_ta foreign key ("ord_order_no")

references "order_table" ("order_no");

alter table "order_detail"

add constraint fk_order_de_reference_product foreign key ("pro_no")

references "product" ("pro_no");

alter table "order_table"

add constraint fk_order_ta_reference_customer foreign key ("cus_no")

references "customer" ("cus_no");

四、 出現的的問題及解決方案

1、連線odbc時,在資料來源列表中找不到local及本機伺服器。解決辦法:直接輸入本機伺服器名。

2、對sql的查詢語句寫約束不是很會

五、 實驗小結。

對於實驗一還是有很多不懂的地方,對powerdesigner有了一定的了解和會了一些基本的操作,實驗的匯入和匯出交為困難,可能是還很不熟練吧,第一次接觸會覺的很複雜。

資料庫建模技術實驗報告

實驗報告書 實驗名稱 資料庫建模技術之資料庫設計 專業班級 111030706 學號 11103070601 11103070619 姓名 陳傑潘耀斌 聯絡 指導老師 李唯唯 實驗時間 2014.4.28 2014.6.16 電腦科學與工程學院計算機實驗室 中心 目錄1.選題背景 對所選題目涉及的企...

資料庫原理實驗報告

實驗題目 資料定義 班級 1x級36 x班 學號 11103060x0x 姓名 實驗一資料定義 一 學時 2學時 二 實驗型別驗證性 設計性 三 實驗目的 利用查詢分析器用sql語言定義基本表 索引並進行相關操作。四 實驗內容 背景材料 在以下實驗中,使用學生 課程資料庫,它描述了學生的基本資訊 課...

資料庫原理實驗報告S9 資料庫索引

要求 1.報告格式和內容要求 a.內容和格式整齊。大標題採用黑體四號字加粗,小標題採用小四號字加粗。正文採用五號宋體,單倍行距。b.貼圖時請剪裁到適當大小,要保證列印時可以看清,但也不要太大以免 越界 c.不要在報告中寫與實驗無關的話,內容要有條理 完整 並能突出重點,要將遇到的主要問題說明。2.檔...