Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relational Theory and Design

Similar presentations


Presentation on theme: "Relational Theory and Design"— Presentation transcript:

1 Relational Theory and Design
Unit 2

2 Key Concepts Relational model concepts
Entity Relationship Diagram (ERD) symbols Primary keys Foreign keys Integrity rules ERD design process Cardinality Data types

3 Terms Database (catalog) Row (record, tuple) Column (field, attribute)
Cell (field, data item) Primary key

4 Entity Concepts Entity – type of item modeled in the database
Attribute – Values describing the entity Relationship – Link between two tables

5 One-to-One Relates one row in the parent to zero or one (or exactly one) in the child. Each student has one locker. Each locker is assigned to one student.

6 One-to-Many Relates one row in the parent to zero or more rows (or one or more rows) in the child. Each teacher teaches multiple classes. Each class has one teacher.

7 Many-to-Many Multiple relationships exist between parent and child.
As associative table is used to track the relationships Each student has multiple teachers. Each teacher has multiple students.

8 Primary key Unique Minimal Not null Nonupdateable
Include Database Design and Development, Exhibit 2-6, page 19

9 Relationships Database Design and Development, Exhibit 2-9, page 20

10 Data Integrity Entity integrity – identifies each row as unique
Referential integrity – Requires matched foreign key values.

11 First Normal Form Database Design and Development, Exhibit 2-13, page 22

12 Database Systems Hierarchical Network Relational Object-oriented

13 Represent Entities as Tables
Entities are the items stored in the database Most represent physical items such as persons and places Start by identifying all possible entities

14 Determine Relationships
Database Systems, Figure 13.12, pg. 405

15 List Fields Fields, or attributes, describe entities.
Most entities will have several attributes.

16 Identify Keys Each table must have a primary key.
Primary key uniquely identfies row. Must be unique, minimal, not null, and nonupdateable. Related child table must have a foreign key

17 Determine Data Types Determine data type and size for each attribute
Primary and foreign keys must match in data type and size

18 Table Database Design and Development, Exhibit 3-1.1, page 32

19 Relationship (none) Database Design and Development, Exhibit 3-1.2

20 Fields Database Design and Development, Exhibit 3-1.3

21 Keys Database Design and Development, Exhibit 3-1.4

22 Data Types Database Design and Development, Exhibit 3-1.5

23 Sample Data Database Design and Development, Exhibit 3-3, page 33

24 Tables Database Design and Development, Exhibit 3-4.1

25 Relationships Database Design and Development, Exhibit 3-4.2

26 Fields Database Design and Development, Exhibit 3-4.3

27 Keys Database Design and Development, Exhibit 3-4.4

28 Data Types Database Design and Development, Exhibit 3-4.5

29 Sample Data Database Design and Development, Exhibit 3-6, Page 35

30 Tables Database Design and Development, Exhibit 3-7.1, page 36

31 Relationships Database Design and Development, Exhibit 3-7.2

32 Fields Database Design and Development, Exhibit 3-7.3, page 37

33 Keys Database Design and Development, Exhibit 3-7.4

34 Data Types Database Design and Development, Exhibit 3-7.5

35 Acme Beer Database Design and Development, Exhibit 3-13, page 48

36 Acme Beer Tables Database Design and Development, Exhibit , page 49

37 Acme Beer Relationships
Database Design and Development, Exhibit

38 Acme Beer Fields Database Design and Development, Exhibit

39 Acme Beer Keys Database Design and Development, Exhibit

40 Acme Beer Data Types Database Design and Development, Exhibit , page 50

41 Amazon Product Screens
Database Design and Development, Exhibit 3-17, page 54

42 Amazon Order Screen Database Design and Development, Exhibit 3-18, page 54

43 Amazon ERD Database Design and Development, Exhibit (only), page 56

44 Amazon Data Database Design and Development, Exhibit 3-22


Download ppt "Relational Theory and Design"

Similar presentations


Ads by Google