Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Modeling IT Key Ideas, Dynamic Database Systems, 2002 Chapter 8.

Similar presentations


Presentation on theme: "Database Modeling IT Key Ideas, Dynamic Database Systems, 2002 Chapter 8."— Presentation transcript:

1 Database Modeling IT Key Ideas, Dynamic Database Systems, 2002 Chapter 8

2 Disk Jockey Appointments IT Key Ideas, Dynamic Database Systems, 2002 1.How is the data ordered? 2.Is any of the data repeated? page 86

3 IT Key Ideas, Dynamic Database Systems, 2002 page 86 1.How is the data ordered? 2.Is any of the data repeated? 3.How might it be possible to save time and space?

4 The second, third, fourth and fifth occurrences of the data shown is redundant. IT Key Ideas, Dynamic Database Systems, 2002 page 87

5 redundant data IT Key Ideas, Dynamic Database Systems, 2002

6 What does this data belong to or have in common? it is all about?the Function Centres The name is not necessarily straightforward it might be called Locations or …

7 IT Key Ideas, Dynamic Database Systems, 2002 What does this data belong to or have in common? it is all about? Appointments

8 1.x IT Key Ideas, Dynamic Database Systems, 2002 A relational database system avoids data redundancy by storing the data that belongs to different entities into separate tables. systems with multiple tables page 87

9 1.x IT Key Ideas, Dynamic Database Systems, 2002 An entity according to the dictionary means “a thing” or “a being” or a “creature”. The taxation office lists an individual, a partnership, an association, a corporation and a company as examples of entities. Entities IT Key Ideas, Dynamic Database Systems, 2002 page 87

10 1.x IT Key Ideas, Dynamic Database Systems, 2002 A key field is an element of data in a table that uniquely defines a record. Key fields page 87

11 which field?

12 1.x IT Key Ideas, Dynamic Database Systems, 2002 There will often be different fields that could be set as a key field. Such fields are called candidate keys, as they are just that, candidates for the key field. Candidate keys page 87

13 IT Key Ideas, Dynamic Database Systems, 2002 Functions There are several candidate keys for the entity about the functions. Namely the Name of the location the Address the Phone Number Note: the Suburb is not because two (or more) Function Centres could be in the one suburb

14 or a new field may be created eg. Location ID Location Code Function Centre ID NB:this is the more likely approach at this level

15 the first four fields form one entity this data is saved in one table IT Key Ideas, Dynamic Database Systems, 2002

16 namely Note:The existence of the Function Centre ID field. IT Key Ideas, Dynamic Database Systems, 2002

17 the other fields form a second entity possibly called, Note: the existence of the Function Centre ID, in order to be able to track where the appointments are. IT Key Ideas, Dynamic Database Systems, 2002 Appointments this data is saved in a second table

18 Relating the tables page 90

19 setting a primary key page 90 select Design View for the Function Centres table select the Function Centre ID field click on the primary key button on the Toolbar IT Key Ideas, Dynamic Database Systems, 2002 save the table

20 relating the tables page 91 select the relationship button on the toolbar IT Key Ideas, Dynamic Database Systems, 2002 add both tables (use the Shift key) and close select the primary key field from the Function Centres table drag and drop this field to its matching field in the Appointments table (its foreign key)

21 Referential Integrity page 91 Data integrity involves ensuring the data is accurate, reliable, appropriate, correct. IT Key Ideas, Dynamic Database Systems, 2002 Referential integrity involves ensuring that a record in the transaction table does not refer to a source entity that does not exist in the source table. In this case, making sure that an Appointment is not entered for a non-existent Function Centre.

22 IT Key Ideas, Dynamic Database Systems, 2002 page 97 Exercise 8.2 Data type, size, defaults, validation

23 IT Key Ideas, Dynamic Database Systems, 2002 Data type, size, defaults, validation

24 IT Key Ideas, Dynamic Database Systems, 2002 page 98Practical 8.3Cleaners

25 IT Key Ideas, Dynamic Database Systems, 2002 Cleaners Data Dictionaries

26 IT Key Ideas, Dynamic Database Systems, 2002 page 101Exercise 8.4Private Detective page 102Exercise 8.5City Tours page 103Exercise 8.6Video Store page 104Exercise 8.7Chauffeur Service

27 Chapter 8 ******************************** IT Key Ideas, Dynamic Database Systems, 2002


Download ppt "Database Modeling IT Key Ideas, Dynamic Database Systems, 2002 Chapter 8."

Similar presentations


Ads by Google