關聯式資料庫.docVIP

  1. 1、本文档共11页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  5. 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  6. 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  7. 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  8. 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
關聯式資料庫.doc

關聯式資料庫 Relational Data Base 基本定義 definition Record(資料錄):橫列資料。單位:筆。 Field(欄):縱行資料。 Primary key(主鍵欄位):通常是「識別碼」欄位。每一筆資料錄均必須有不同的識別碼。若是須要多個欄位才能識別出不同之資料錄,則稱之為「複合主鍵」(composite primary keys)。 A primary key is a field whose values are unique. For example, ID is most commonly used as a primary key. Composite primary keys are a set of keys whose composite values are unique. Foreign key(外鍵欄位):本表之(外鍵)欄位為另一表的主鍵欄位。透過外鍵欄位可以將各個表格關聯起來。(註:在本表外鍵欄位下的值可能非唯一,但其在所對應到的它表主鍵欄位中,必須是唯一) A foreign key in a table must be a primary key of another table. Different tables are related via foreign key(s). Noted that values of foreign key can be duplicate. Schema (綱目):欄位名稱,不包括資料錄。資料庫設計的對象是綱目,而非資料錄。(在設計階段亦無從得知真正的資料錄為何)。例如上表之綱目為:(姓名,身分證字號,年齡,通訊處,公司代號,年資)。 A schema is a set of field names without order and record. The object of database design is schema instead of records. As a matter of fact, it may be no record when a database is designed. For example, the schema of the upper table in the following figure is denoted as (name, staff-ID, age, address, company-ID, years-on-duty). Company-ID is a foreign key of the upper table, while it is the primary key of the lower table. 【作業 HW】 表單Students的綱目(schema)為(姓名,學號,年齡,通訊處,家長,班級)。表單Class的綱目為(班級,班長,導師,人數)。試問此二表單之主鍵、外鍵各為何?理由為何?Class有外鍵嗎? There are two tables, namely STUDENTS and CLASS. The schema of STUDENTS is (name, student-ID, age, address, parent, class-ID). The schema of CLASS is (class-ID, chief, teacher-in-charge, number-of-students). Please indicate the primary key(s) and foreign key(s) of these two tables with your reasons. Does CLASS have any foreign key? 【作業HW】 請設計由多個表單所組成的交通資料庫綱目,並分別指出其主鍵、外鍵。 Please design a set of transportation schema, and indicate their primary and foreign keys. 基本原理 Principle 將一張大表,拆成數張小表,但須可以組合成原來的表格。 A big table can be decomposed into several smaller tables. These smaller tables should be composed back to the original table without losing any record or having any extra record that is not in the original table. 將表一拆成表二、三,再組成(join

文档评论(0)

ailuojue + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档