MIS 111: Computers and the inter-networked society

42
MIS 111: COMPUTERS AND THE INTER-NETWORKED SOCIETY Class 8: Data Management July 20 th , 2011

description

MIS 111: Computers and the inter-networked society. Class 8: Data Management July 20 th , 2011. News. Announcements. Grades are posted: http://www.u.arizona.edu/~ jjenkins/mis111_summer2011/grades/grades.htm Check them often to make sure I haven't made a mistake - PowerPoint PPT Presentation

Transcript of MIS 111: Computers and the inter-networked society

Page 1: MIS 111:  Computers and the inter-networked society

MIS 111: COMPUTERS AND THE INTER-NETWORKED SOCIETY

Class 8: Data ManagementJuly 20th, 2011

Page 2: MIS 111:  Computers and the inter-networked society

NEWS

Page 3: MIS 111:  Computers and the inter-networked society

ANNOUNCEMENTS Grades are posted:

http://www.u.arizona.edu/~jjenkins/mis111_summer2011/grades/grades.htm

Check them often to make sure I haven't made a mistake

New Office Location (E-commerce Lab conference room)

Today I’ll be there only until 11:40 Web sites looks great! I was hoping to give you the entire day of

Friday to work on your assignment 2, but I might have to lecture a bit too.

Page 4: MIS 111:  Computers and the inter-networked society

LEARNING OBJECTIVES Define the basic components of an ER

diagram Be able to construct a complete ER

diagram based on a simple business case

Be able to critique ER diagrams

Page 5: MIS 111:  Computers and the inter-networked society

THIS WEEK Today: Entity Relationship Diagrams

Thursday: Relational TablesQuiz

Friday: Assignment #1Meet in McClelland Hall 218

Page 6: MIS 111:  Computers and the inter-networked society

WHY ARE WE DOING THIS? Businesses can live or die by the

management of their data Businesses, especially online

businesses, have a TON of data to manage

Peter Chen’s entity relationship diagrams are an extremely effective way to conceptualize data

I <3 ERD

Page 7: MIS 111:  Computers and the inter-networked society

OUR BUSINESS CASE Happy Hills High School has

commissioned us to keep track of its operations.

They need to track information about students, teachers, and courses.

Where we’ll start:They need to keep track of students’ id

numbers, names, and email addresses.

Page 8: MIS 111:  Computers and the inter-networked society

WARNING: NOTES ENCOURAGED

DEFINITIONS AHEAD

Page 9: MIS 111:  Computers and the inter-networked society

ENTITY RELATIONSHIP DIAGRAMS

Page 10: MIS 111:  Computers and the inter-networked society

ENTITIES AND ENTITY CLASSES

Entity – a person, place, thing or event about which information is maintained

Entity Class – an abstract representation of ALL of a particular type of entity

STUDENTS

Page 11: MIS 111:  Computers and the inter-networked society

ATTRIBUTES Attribute – a characteristic or quality of

a particular entity class Identifier– an attribute that uniquely

identifies an entity class (always underlined)

STUDENTS

StudentID StudentEmail

StudentName

Page 12: MIS 111:  Computers and the inter-networked society

EXAMPLE: TEACHERS We want to represent all teachers and

keep track of their names, email addresses, and salaries.

TEACHERS

TeacherID

TeacherName TeacherEma

ilTeacherSala

ry

Page 13: MIS 111:  Computers and the inter-networked society

EXAMPLE: COURSES We want to represent all courses and

keep track of course numbers and course names.

COURSES

CourseNo CourseName

Page 14: MIS 111:  Computers and the inter-networked society

WHAT’S NEXT? We have created the STUDENTS,

TEACHERS, and COURSES entity classes.

We gave each entity class its own attributes.

We also provided each entity class with a unique identifier.

What more can we represent?

Page 15: MIS 111:  Computers and the inter-networked society

RELATIONSHIPS STUDENTS enroll in COURSES.

STUDENTS COURSESenroll in

CourseNo

CourseName

StudentID

StudentName

StudentEmail

Page 16: MIS 111:  Computers and the inter-networked society

EXAMPLE: TEACHERS AND COURSES

TEACHERS teach COURSES.

COURSESCourseN

oCourseNam

e

TEACHERS

teach

TeacherID

TeacherName

TeacherEmail

TeacherSalary

Page 17: MIS 111:  Computers and the inter-networked society

LET’S PUT THE ERD TOGETHER

STUDENTS

COURSES

enroll in

CourseNo CourseNam

e

StudentID

StudentName

StudentEmail

TEACHERSteac

h

TeacherID

TeacherName

TeacherEmail

TeacherSalary

Page 18: MIS 111:  Computers and the inter-networked society

LET’S KEEP ON GOING: ADVENTURE AWAITS

Page 19: MIS 111:  Computers and the inter-networked society

CARDINALITY Cardinality – defines a relationship

between two entity classes in terms of how many instances of X are allowed for each instance of Y

STUDENTS COURSESenroll in

CourseNo

CourseName

StudentID

StudentName

StudentEmail

Page 20: MIS 111:  Computers and the inter-networked society

BUSINESS RULES Cardinality is often defined by certain

business rules. For example, Happy Hills High School

has the following business rules:

A student must enroll in at least four classes to be considered a full-time student.

A student may enroll in no more than six courses at a time.

Course enrollment may not exceed thirty students.

Page 21: MIS 111:  Computers and the inter-networked society

CARDINALITY In a binary relationship, we must ask

four questions: 1. For each COURSE, what is the

minimum number of STUDENTS I may have?

2. For each COURSE, what is the maximum number of STUDENTS I may have?

[0:30]STUDENTS COURSESenroll

in

Page 22: MIS 111:  Computers and the inter-networked society

CARDINALITY 3. For each STUDENT, what is the

minimum number of COURSES I may have?

For each STUDENT, what is the maximum number of COURSES I may have?

[0:30]STUDENTS COURSESenroll

in[4:6]

Page 23: MIS 111:  Computers and the inter-networked society

NOTE We call this in general a “many-to-

many” relationship because each entity class may have more than one instance.

Many-to-many = [M:N]

[0:30]STUDENTS COURSESenroll

in[4:6]

Page 24: MIS 111:  Computers and the inter-networked society

EXAMPLE: TEACHERS TEACH COURSES

1. For each COURSE, what is the minimum number of TEACHERS I may have?

2. For each COURSE, what is the maximum number of TEACHERS I may have?

COURSES

TEACHERS

teach

TeacherID

TeacherName

TeacherEmail

TeacherSalary

CourseNo CourseNam

e

[0:1]

Page 25: MIS 111:  Computers and the inter-networked society

EXAMPLE: TEACHERS TEACH COURSES

3. For each TEACHER, what is the minimum number of COURSES I may have?

4. For each TEACHER, what is the maximum number of COURSES I may have?

COURSES

TEACHERS

teach

TeacherID

TeacherName

TeacherEmail

TeacherSalary

CourseNo CourseNam

e

[0:1]

[1:3]

Page 26: MIS 111:  Computers and the inter-networked society

NOTE We call this in general a “one-to-many”

relationship because one side may only have up to one instance and the other may have many.

One-to-Many = [1:M]

COURSES

TEACHERS

teach

[0:1]

[1:3]

Page 27: MIS 111:  Computers and the inter-networked society

YOUR TURN! Prettiest Puppies & Co. operates a chain of pet

stores that sell puppies to customers looking for new furry friends. The management would like to be able to keep track of which puppies are bought by which customers, as well as which stores in the chain sell which puppies.

Management would like to track puppy breeds, ages when sold, and temperaments. They would also like to keep track of each customer’s last name, gender, and zip code. Finally, they need to keep track of each store’s name and location.

Page 28: MIS 111:  Computers and the inter-networked society

ERD: PRETTIEST PUPPIES & CO.

PUPPIES STORES

CUSTOMERS

buy

sell

StoreID

StoreName StoreLoc

PupAgeWhenSold

PupBreed

PupTempPupID

CustZip

CustName

CustGender

CustID

[1:1]

[1:M]

[0:1]

[1:M]

Page 29: MIS 111:  Computers and the inter-networked society

ONE MORE THING… There are different types of entity

classes.

Strong entity classes are entity classes that can exist by themselves. They are existence independent.

Weak entity classes, on the other hand, are entity classes that are existence dependent. In other words, they depend upon the existence of one or more strong entities to exist.

Page 30: MIS 111:  Computers and the inter-networked society

EXAMPLE: DOCTORS AND PATIENTS DOCTORS treat PATIENTS. When a

PATIENT sees the DOCTOR, a TREATMENT is prescribed.

Can a TREATMENT exist without the presence of a DOCTOR and PATIENT?

Page 31: MIS 111:  Computers and the inter-networked society

DOCTORS, PATIENTS, AND TREATMENTS

Weak entity classes are represented by concentric rectangles.

DOCTORS PATIENTS

TREATMENTS

treat

Page 32: MIS 111:  Computers and the inter-networked society

WHAT ABOUT THE FIRST EXAMPLE?

What information did we want to track???Which STUDENTS are enrolled in which

COURSESWhich TEACHERS are teaching which

COURSES

STUDENTS COURSESenrol

l in

TEACHERS

teach

QUESTION: Could each COURSE have existed by itself?

ANSWER: Yes. The COURSE was always in the catalog and did not need either TEACHERS or STUDENTS to exist.

Page 33: MIS 111:  Computers and the inter-networked society

WEAK ENTITY CLASSES AND CARDINALITY

Rule: The strong entity classes upon which the weak entity class depends must have a minimum cardinality of 1 or greater.

DOCTORS PATIENTS

TREATMENTS

treat

[1: [1:

Page 34: MIS 111:  Computers and the inter-networked society

TERNARY RELATIONSHIPS AND

CARDINALITY New question: For every combination of

DOCTOR and PATIENT, what is the minimum/maximum number of TREATMENTS I may have?

DOCTORS PATIENTS

TREATMENTS

treat

[1: [1:

[0:M]

Page 35: MIS 111:  Computers and the inter-networked society

TERNARY RELATIONSHIPS AND

CARDINALITY Q3 & 4. For every combination of

DOCTOR and TREATMENT, what is the min/max number of PATIENTS I may have?

DOCTORS PATIENTS

TREATMENTS

treat

[1: [1:1]

[0:M]

Page 36: MIS 111:  Computers and the inter-networked society

TERNARY RELATIONSHIPS AND

CARDINALITY Q5 & 6. For every combination of

PATIENT and TREATMENT, what is the min/max number of DOCTORS I may have?

DOCTORS PATIENTS

TREATMENTS

treat

[1:1]

[1:1]

[0:M]

Page 37: MIS 111:  Computers and the inter-networked society

NOTE We call this in general a “one-to-one”

relationship because both entity classes may only have a maximum of one instance.

One-to-one = [1:1]

DOCTORS PATIENTStreat

[1:1] [1:1]

Page 38: MIS 111:  Computers and the inter-networked society

NOTE

Weak entity classes do NOT have identifiers.

Page 39: MIS 111:  Computers and the inter-networked society

YOUR TURN Twinkle Tones School of Music provides

private lessons only by musician request. When a musician requests a private lesson, the School finds an available instructor and arranges a lesson schedule.

The School would like to track these lessons – the day of the week when they are scheduled, as well as the time they begin.

The School would also like to track musician names and email addresses, as well as instructor names and email addresses.

Page 40: MIS 111:  Computers and the inter-networked society

TWINKLE TONES PRIVATE LESSONS

INSTRUCTORS MUSICIANSteach

LESSONS

MusIDMusNam

e

MusEmail

InsID

InsEmailInsName

TimeDay

[0:M]

[1:1]

[1:1]

Page 41: MIS 111:  Computers and the inter-networked society

TOMORROW’S CLASS We are going to take these entity

relationship diagrams and turn them into relational tables!

FYI: Microsoft Visio Quiz! Bring your computer with excel

Page 42: MIS 111:  Computers and the inter-networked society

PAY SPECIAL ATTENTION TO THESE LEARNING OBJECTIVES: List the three rules of the Long tail. Define Service Oriented Architecture

(SOA) List 4 benefits of SOA List the four steps of Search Engine

Optimization List at least four HCI design principles

for Web sites List three examples of HCI applications

today Be able to critique ER diagrams