第8章データ管理
TECHNOLOGY IN EVERYDAY LIFE日常生活の中の技術
RDBMSRDBMS
Airplanes have to be designed and tested for safety. Airplane wings are complex items that include a large number of parts, come in various shapes and forms (e.g., rectangular wings for small airplane, elliptical wings, tapered wings and trapezoidal wings), and require multiple designers to collaborate on their design. Airplane wings are typically designed using computer-aided design (CAD) software systems that use data management systems to store and retrieve data.
英語のヒント
飛行機は、安全性を考慮して設計し、試験しなければならない。翼は多数の部品を含む複雑なもので、さまざまな形状や形式がある。たとえば小型機用の長方形の翼、楕円翼、先細りの翼、台形翼などである。設計には、複数の設計者の協力が必要になる。飛行機の翼は、通常、コンピューター支援設計(CAD)のソフトウェアシステムで設計し、そのシステムは、データの格納と取得にデータ管理システムを使う。
Is a RDBMS the best solution to store and retrieve these types of items? Why or why not? Are there other, better ways to track the development, design, and testing of mechanical parts crucial to passenger safety?
英語のヒント
このようなものを保存し、取り出すために、RDBMSが最適な解決策だろうか。その理由、またはそうでない理由は何か。乗客の安全に極めて重要な機械部品の、開発・設計・試験を追跡する、ほかのよりよい方法はあるだろうか。
Relational Model Constraints関係モデルの制約
The constraints that ensure database correctness are called relational model constraints in DBMS. The different types of constraints are domain, uniqueness, key, and entity integrity constraints. The domain constraint defines the domain of values for an attribute. The uniqueness constraint specifies that all the tuples must be unique. The key constraint specifies that all the values of the primary key must be unique. The entity integrity constraint specifies that no primary key contains a null. Additionally, functional dependency (FD) is a constraint that specifies the relationship between two sets of attributes and provides a formal tool for the analysis of relational schemas. FDs enable the detection and description of business rules in precise terms. FDs can be used to help normalize relational schemas. A multivalued dependency (MVD) occurs when two attributes in a table are independent of each other but both depend on a third attribute. MVDs are required to achieve higher forms of normalization (e.g., 4NF). The normalization process can be automated using algorithms that can convert a given relation into sets of relations in a given normal form.
英語のヒント
DBMSにおいて、データベースの正しさを保証する制約を、関係モデル制約という。種類には、定義域制約、一意性制約、キー制約、実体整合性制約がある。定義域制約は、属性の値の範囲を定義する。一意性制約は、すべてのタプルが一意でなければならないと定める。キー制約は、主キーのすべての値が一意でなければならないと定める。実体整合性制約は、主キーがヌルを含んではならないと定める。さらに、関数従属性(FD)は、二つの属性の集合の間の関係を指定する制約であり、関係スキーマを分析するための形式的な道具になる。FDは、業務規則を見いだし、厳密な言葉で記述することを可能にし、関係スキーマの正規化を助けるために使える。多値従属性(MVD)は、表の中の二つの属性が互いに独立しているが、両方とも第三の属性に依存する場合に生じる。より高い正規形、たとえば第4正規形を得るには、MVDが必要になる。正規化の処理は、ある関係を、指定した正規形の関係の集合へ変換するアルゴリズムを使って、自動化できる。
Normalization正規化
The process of structuring a relational database to reduce data redundancy and improve data integrity is called database normalization. A normal form applies to a table/relation, not to the database. The main types of normalization are
英語のヒント
データの冗長性を減らし、整合性を高めるために、関係データベースの構造を整える処理を、データベース正規化という。正規形は、データベース全体ではなく、表または関係に適用する。主な正規化の種類は、次のとおりである。
• first normal form (1NF),
• 第1正規形(1NF)。
• second normal form (2NF),
• 第2正規形(2NF)。
• third normal form (3NF),
• 第3正規形(3NF)。
• Boyce-Codd normal form (BCNF), and
• ボイス・コッド正規形(BCNF)。
• fourth normal form (4NF).
• 第4正規形(4NF)。
There are additional normal forms, which are more complex. Each cell in 1NF must contain only a single (atomic) value and every column must be uniquely named. The relational model requires tables to be in 1NF form; tables in 2NF must be in 1NF and not have any partial dependency. Tables in 3NF must be in 2NF and have no transitive functional dependencies. BCNF is a higher version of the 3NF and is used to address the anomalies. Tables in 4NF must be in BCNF/3NF and not have MVDs. The following example converts a table to 1NF, 2NF, and then 3NF. Table 8.3 contains the original data, that is then converted to 1NF (Table 8.4), 2NF (Table 8.5), and 3NF (Table 8.6, Table 8.7, and Table 8.8). It is assumed here that the Customer Name is a composite attribute that contains First Name and Last Name and therefore must be broken down into its component attributes to be stored in a relational table that satisfies 1NF.
英語のヒント
さらに複雑な正規形もある。第1正規形(1NF)では、各セルに一つだけの、分割できない値を含め、各列に一意の名前を付けなければならない。関係モデルでは、表が1NFであることを求める。第2正規形(2NF)の表は、1NFであり、部分従属性を一切持たない必要がある。第3正規形(3NF)の表は、2NFであり、推移的な関数従属性を持たない必要がある。BCNFは3NFの上位の形であり、異常への対処に使う。4NFの表は、BCNF/3NFであり、多値従属性を持たない必要がある。以下の例では、表を1NF、2NF、そして3NFへ変換する。表8.3に元のデータがあり、それを1NF(表8.4)、2NF(表8.5)、3NF(表8.6、表8.7、表8.8)へ変換する。ここでは、Customer Name(顧客名)はFirst Name(名)とLast Name(姓)を含む複合属性だと仮定する。そのため、1NFを満たす関係表に格納するには、構成する属性へ分解しなければならない。
Customer Name 顧客名 | Item 1 商品1 | Item 2 商品2 |
|---|---|---|
Shirl Adam | Milk 牛乳 | Bread パン |
Jeff Mark | Juice ジュース | Water 水 |
Rana Park | Bread パン | Milk 牛乳 |
Table 8.3 Data Table
表8.3 データの表
First Name 名 | Last Name 姓 | Item 1 商品1 | Item 2 商品2 |
|---|---|---|---|
Shirl | Adam | Milk 牛乳 | Bread パン |
Jeff | Mark | Juice ジュース | Water 水 |
Rana | Park | Bread パン | Milk 牛乳 |
Table 8.4 Table Converted to 1NF
表8.4 第1正規形へ変換した表
First Name 名 | Last Name 姓 | Item 商品 |
|---|---|---|
Shirl | Adam | Milk 牛乳 |
Shirl | Adam | Bread パン |
Jeff | Mark | Juice ジュース |
Jeff | Mark | Water 水 |
Rana | Park | Bread パン |
Rana | Park | Milk 牛乳 |
Table 8.5 Table Converted to 2NF
表8.5 第2正規形へ変換した表
Customer ID 顧客ID | First Name 名 | Last Name 姓 |
|---|---|---|
1 | Shirl | Adam |
2 | Jeff | Mark |
3 | Rana | Park |
Table 8.6 Table Converted to 3NF: Customer
表8.6 第3正規形へ変換した表:顧客
Item ID 商品ID | Item 商品 |
|---|---|
1 | Milk 牛乳 |
2 | Bread パン |
3 | Juice ジュース |
4 | Water 水 |
Table 8.7 Table Converted to 3NF: Item
表8.7 第3正規形へ変換した表:商品
Customer ID 顧客ID | Item ID 商品ID |
|---|---|
1 | 1 |
1 | 2 |
2 | 3 |
2 | 4 |
Table 8.8 Table Converted to 3NF: Relational Table
表8.8 第3正規形へ変換した表:関連の表