52

Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Embed Size (px)

Citation preview

Page 1: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 2: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 3: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 4: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 5: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 6: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 7: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 8: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Entities “something about which an e.g.

organisation keeps data” customer

Attributes “the properties of an entity” e.g.

address

Relationships “the connections e.g. between entities”

customer

places

order

Page 9: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Entities

An entity may be physical:

an employee, a part, a machine

Or conceptual:

a project, an order, a course

A particular employee is an “entity occurrence” of the employee entity

Page 10: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Attributes

An EMPLOYEE has: A PROJECT has:

an age a project leader

a salary a start date

an address a cost

Page 11: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Relationships

Relationships link entities:

An employee works on a project

A part is made on a machine and appears on an order

An employee attends a course

Page 12: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Describing Entities and Relationships

Factory Entity (Master)

Relationship (1:many)

“makes”

Entity (Detail)Component

Page 13: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Relationships and Entities

Factory

Component

Given a factory

we can tell which

components it makes

Given a component

we can tell which

factory makes it

Page 14: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

One to Many Relationships

A

B

For any occurrence of A

there may be 0,1 or many

occurrences of B

Page 15: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

One to One Relationships

Factory Manager

Factory

Usually one entity should be an attribute of the other

Sometimes the diagram requires one-to-one

Page 16: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Many to Many Relationships

component order

One component

appears on

Many orders

One order Is for

Many components

Page 17: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 18: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

A database to track motorbike maintenance.

In the databases described by the following 2 LDS's, a player's performance in matches is recorded, from slightly different perspectives.

Page 19: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 20: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 21: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 22: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Exercise: Data Modelling• 1. A customer purchasing a lot of order from the salesperson

• 2. Two accountants preparing the sales reports to the senior managers

• 3. A credit card holder have the following personal information: name, address, age

• 4. A school had a lot of departments such as IT, Accounting, Math's, etc. Each department is consists of 6 lecturers. Each lecturer handles maximum of two classes in one day. Each class could only accommodate maximum of 40 students.

Page 23: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Exercise :DFD• Travel Agency

A travel agency arranges holidays for customers. Bookings are made directly by customers. When a customer makes an approach, the reservations clerk selects appropriate flight details and hotel details from lists which are regularly updated. The details are entered onto a Provisional Booking file.

The customer must confirm this booking within three days by sending a deposit of 10% of the costs. On receipt of the deposit, Reservations transfer the details from the Provisional Bookings file to the Full Bookings file.

Four weeks before the flight is due, Accounts send an invoice to the customer for the remaining costs. Accounts notify Customer services when the full payment is received, and Customer Services then send tickets and joining instructions to the customer.

Page 24: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 25: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 26: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 27: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 28: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 29: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

JSP

Page 30: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

JSP

Page 31: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 32: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 33: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 34: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 35: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 36: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 37: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Counts the number of times words occur in a file

Counts the number of times words occur in a file

Page 38: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 39: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 40: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 41: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 42: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Flowchart Exercises

If student's grade is greater than or equal to 60Print "passed“ else Print "failed“

Create a flowchart for Adding two numbers

Create a flowchart for inputting your employee’s name. If the first letter starts from A to J then display “ First Category” , if K to T then display “ Second Category” otherwise display Third Category

Set the counter to 0. If the counter is more than 10 then customer receives free value meal otherwise no free value meal.

Page 43: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

Flowchart ExerciseSet total to zeroSet grade counter to oneWhile grade counter is less than or equal to ten• Input the next grade• Add the grade into the total • Set the class average to the total divided by ten• Print the class average.

Page 44: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 45: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 46: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 47: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 48: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 49: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 50: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 51: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the
Page 52: Entities“something about which an e.g. organisation keeps data” customer Attributes“the properties of an entity”e.g. address Relationships“the

End