You are on page 1of 94

BUSS 215

Business Analytics (I)

Jiye BAEK
Department of MIS
Korea University Business School
TODAY

BUSS215: Introduction to MIS

Fundamentals IT Trends and Applications

Online Platform

Digital Economy
Business Analytics

Big Data Analytics


E-Commerce

Emerging Technologies

BUSS215 © Jiye BAEK 2


Data management + Business Analytics
support key trends in data-driven enterprises and BIG
data

BUSS215 © Jiye BAEK 3


Data management + Business Analytics
support key trends in data-driven enterprises and BIG
data
BUSS215: Introduction to MIS

Fundamentals IT Trends and Applications

Online Platform

Digital Economy
Business Analytics

Big Data Analytics


E-Commerce

Emerging Technologies

BUSS215 © Jiye BAEK 4


Data management + Business Analytics
support key trends in data-driven enterprises and BIG
data
Database Design and Administration
Fundamental concepts of database management systems and their usage for
managing the information resources of an organization; methodologies for designing
and managing a database system to support business applications.

Business Intelligence and Data Mining


This course covers the fundamental concepts, technologies, and applications of
business intelligence (BI) to help firms gain a competitive advantage. Topics include
data mining, data warehousing, business analytics, data visualization, business
performance management, etc. Students will gain hands-on experience with popular
BI tools.

BUSS215 © Jiye BAEK 55


BUSINESS ANALYTICS(I)
Database
What is database
E-R Diagram
Database design

BUSS215 © Jiye BAEK 6


What makes up an MIS?

BUSS215 © Jiye BAEK 7


IT Infrastructure

Networking

IT
Hardware Software
Infrastructure

Data
management

8
IT Infrastructure

Networking

IT
Hardware Software
Infrastructure

Data
management

9
HAVE YOU EVER EXPERIENCED THIS?

10
HOW CAN AMAZON KEEP TRACK OF
SO MANY ORDERS, CUSTOMERS, AND PRODUCT?

11
12
DATABASE MANAGEMENT SYSTEMS (DBMS)

BUSS215 © Jiye BAEK 13


14
BUSS215 © Jiye BAEK 15
BUSS215 © Jiye BAEK 16
BUSS215 © Jiye BAEK 17
BUSS215 © Jiye BAEK 18
BUSS215 © Jiye BAEK 19
PROBLEMS WITH LISTS
Problems with lists (traditional file environment)
Data redundancy
Presence of duplicate data in multiple files
Data inconsistency
Same attribute has different values
Poor security
Lack of data sharing and availability

Problems with data redundancy


Waste of space to have duplicate data
Causes more maintenance headaches
Data changes in one file could cause inconsistencies

BUSS215 © Jiye BAEK 20


BUSS215 © Jiye BAEK 21
BUSS215 © Jiye BAEK 22
BUSS215 © Jiye BAEK 23
BUSS215 © Jiye BAEK 24
BUSS215 © Jiye BAEK 25
BUSS215 © Jiye BAEK 26
BUSS215 © Jiye BAEK 27
BUSS215 © Jiye BAEK 28
BUSS215 © Jiye BAEK 29
CUSTOMER TABLE

BUSS215 © Jiye BAEK 30


PRODUCT TABLE

BUSS215 © Jiye BAEK 31


ORDER TABLE

BUSS215 © Jiye BAEK 32


DBMS is not very good at visualizing tables and relations
à Thus, ER Diagram

BUSS215 © Jiye BAEK 33


BUSS215 © Jiye BAEK 34
BUSS215 © Jiye BAEK 35
SIMPLE ERD LOOKS LIKE THIS

BUSS215 © Jiye BAEK 36


HOW DO DATA MODELS FACILITATE DATABASE DESIGN?

37
37
38
39
40
ENTITY RELATIONSHIP DIAGRAM
Entity and Attributes
Entity
Generalized category representing person, place, thing on which we
store and maintain information
E.g., Supplier, Part

Attributes
Specific characteristics of each entity
E.g., Supplier’s name, Supplier’s address, Part’s description, Part’s unit price

BUSS215 © Jiye BAEK 41


BUSS215 © Jiye BAEK 42
EACH TABLE = ENTITY

BUSS215 © Jiye BAEK 43


COLUMN = ATTRIBUTE

BUSS215 © Jiye BAEK 44


BUSS215 © Jiye BAEK 45
ENTITY RELATIONSHIP DIAGRAM
How is data stored in a
database? Table
Student ID First N. Last N. Group N.
20129382 Amy Wong Group TW
20234876 Lily Lewis Group FB
Primary key 32743524 Joe Winson Group TW
23746423 Alex Tam Group TW
A special attribute, or group of special
45734653 Jimmy Tam Group FB
attributes, that uniquely identifies an 28935762 Alex Chan Group IG
individual record 93457347 Howard Lee Group IG

Cannot be duplicated 93588723 Doe Smith Group FB



Primary Key… … …
Examples
• your ID number can be used to identify you
and only you in Blackboard database Primary Key Rules
• order number to describe “who sells which
product to whom”
1. Unique
NOT every attribute can be a primary key. 2. Never Changing
3. Never null

BUSS215 © Jiye BAEK 46


WHAT ARE THE PRIMARY KEYS?

BUSS215 © Jiye BAEK 47


PRIMARY KEYS

PK Customer_ID

PK Product_ID PK Order_ID

BUSS215 © Jiye BAEK 48


PRIMARY KEY

BUSS215 © Jiye BAEK 49


PRIMARY KEY

BUSS215 © Jiye BAEK 50


PRIMARY KEY

BUSS215 © Jiye BAEK 51


PRIMARY KEY

BUSS215 © Jiye BAEK 52


PRIMARY KEY

BUSS215 © Jiye BAEK 53


RELATIONAL DATABASE
Relational Database
Use common fields between tables to create linkage between them

This common field must be the primary key for one of the tables
linked, and it is called a foreign key for the other table.
A foreign key has to be a primary key in another table

Customer table
Cust. ID Cust. Name Reward Program
… … …

Cust. ID is
Ø the primary key for
Transaction table the customer table
Trans. Trans. Store ID Cashier Cust. ID Prod. ID Ø the foreign key for
ID Time ID the transaction table
… … … … …

BUSS215 © Jiye BAEK 54


FOREIGN KEYS

BUSS215 © Jiye BAEK 55


FOREIGN KEYS

Customer_ID FK

Product_ID FK

BUSS215 © Jiye BAEK 56


FOREIGN KEYS

Foreign keys don’t have to be unique.


They can be repeated in a table.
There can be multiple foreign keys in one entity
Customer_ID FK

Product_ID FK

BUSS215 © Jiye BAEK 57


PK AND FK

BUSS215 © Jiye BAEK 58


BUSS215 © Jiye BAEK 59
BUSS215 © Jiye BAEK 60
BUSS215 © Jiye BAEK 61
BUSS215 © Jiye BAEK 62
CARDINALITY
▊ Cardinality – a property of a relationship, the extent of participation
‧ Can an employee be managed by one manager, or by many manager(s)?
‧ Can a sale transaction involved many customers, or only one?

▊ Useful for understanding and defining business rules

▊ Defining constraints on entity-participation in the relationship

▊ Can capture both the minimum and maximum degree of participation


‧ E.g., should a student participate at least in one course?

▊ In
the ERD – cardinality is represented by using the “crows-foot”
notation

63
63
CARDINALITY
CARDINALITY RELATIONS VISUALIZED

64
64
CARDINALITY
CARDINALITY EXAMPLES

Each instance of A is related to a minimum of


A B
zero and a maximum of one instance of B

Each instance of B is related to a minimum of


A B
one and a maximum of one instance of A

Each instance of A is related to a minimum of


A B
one and a maximum of many instances of B

Each instance of B is related to a minimum of


A B
zero and a maximum of many instances of A

65
65
REPRESENTING CARDINALITIES IN ERD
(HOW SHOULD WE “READ” THESE EXAMPLES?)

Manages
Manager Department

A manager manages one and only one department, and a department is managed by
one and only one manager

Works at/Employed by
Employee Resort

An employee works at zero or one resort, and a resort employees one or more employees

Visits Resort
Customer

A customer visits one or more resorts, and each resort may have zero or more (zero, one or
many) customers.

66
66
BUSS215 © Jiye BAEK 67
ENTITY

▊ The
entity (or entity-class) represents a type of object with some
common characteristics:
‧ Persons: agency, contractor, customer, department, division, employee, instructor,
student, supplier
‧ Places: sales region, building, room, branch office, campus
‧ Objects: book, machine, part, product, raw material, software license, software package,
tool, vehicle model, vehicle
‧ Events: application, award, cancellation, class, flight, invoice, order, registration, renewal,
requisition, reservation, sale, trip
‧ Concepts: account, block of time, bond, course, fund, qualification, stock

▊ We can say that the entities are the “nouns” in our data model

▊ In
the ERD we represent each entity by a rectangle with the unique
name.
‧ Choose a simple name that makes business sense (Business rule)
‧ Entity names are Singular – E.g., “Student” not “Students”

68
68
EXAMPLE – ENTITIES IN A HOTEL ENVIRONMENT

• Which entities are important?


• Resort
• Customer
• Employee Resort Customer
• Product
– What are the products in this case?
– Any other important entity?
Employee Product

69
69
RELATIONSHIPS

▊ Therelationship (or relationship-class) represents how instances that


belong to two or more entities are associated with each other in the
“real-world”
‧ If entities are the “nouns”, relationships are the “verbs” or verb phrases…
‧ E.g., An instructor (entity) teaches course (entity) to a student (entity)

▊ In
the ERD – a relationship is often represented by a “straight line
connecting two entities.

70
70
EXAMPLE – RELATIONSHIP

1. A Customer visits a Resort


2. An Employee serves a Customer Resort Visits Customer
3. A Customer buys a Product
– Can you detect any other important
relationships in this diagram?

es
Buys

rv
Se
Employee Product

71
71
A FULL DIAGRAM

Resort Visits
Customer
Offer ces
s Ser vi
Works At Buys

Employee Sells
Product

72
72
ATTRIBUTES (FIELDS)

▊ Characteristics of an entity or a relationship

▊ The “data” elements that are important to collect about instances of


entities and relationships
‧ E.g. Student: Student-ID, First Name, Last Name
‧ E.g. Course: Course-Number, Title, Section, Semester, Year

73
73
Customer
Resort Customer ID#
Resort ID# Cust Name
Resort Name Cust Type
Address Line 1 Visits Cust Phone #
City Cust Arrival Date
State Cust Depart Date
Zip
Offers
r ves
se

Buys
Works
at
Employee Product
Employee ID# Product ID#
Employee Name Item
Salary Sells Unit Price
Position Name

74
74
Customer
Resort Customer ID#
Resort ID# Cust Name
Resort Name Cust Type
Address Line 1 Visits Cust Phone #
City Cust Arrival Date
State Cust Depart Date
?? ??
Zip Offers es
r v
se
Buys
Works at
?? ?? Product
Employee Sells
Employee ID# Product ID#
Employee Name Item
Salary Is Sold by Unit Price
Position Name

What Cardinalities should be in place where the red circles exist?


75
75
ERD – THE IMPORTANCE OF PROPER DESCRIPTION

▊ The
ERD provides a convenient visual representation of the
conceptual/logical model
‧ A great communication tool between business managers and IT-personnel

▊ However… the diagram alone doesn’t provide all the information


needed!

▊ Together
with the diagram, it is important to provide some
documentation that describes:
‧ The entity, the relationships, and their attributes
‧ Justify the cardinalities
§ Especially, if any of the above is not obvious and “straight forward”

76
76
CONVERTING AN ERD TO DATABASE DESIGN

● If the ERD is the logical model, Database Design is the physical model

● Conversion
o Entities become tables
o Entity’s attributes become table columns
o Add Foreign Keys (create table columns for foreign keys)
o Create intermediary tables for many-to-many-relationships

77
CONVERTING AN ERD TO DATABASE DESIGN

STUDENT
Student ID
Last Name
First Name

Enrolls in/Contain

PROFESSOR
SECTION CLASSROOM
Professor ID
FirstName Taught by Section ID Is taught in Room ID
LastName Time Room Number
Email Room ID Room Capacity
Phone

Sample ERD Diagram with Cardinality

78
CONVERTING AN ERD TO DATABASE DESIGN

ERD DB DESIGN

PROFESSOR PROFESSOR PROFESSOR

SECTION SECTION
SECTION

ERD Entities become tables

79
CONVERTING AN ERD TO DATABASE DESIGN

ERD DB DESIGN

PROFESSOR PROFESSOR PROFESSOR

Professor ID ProfessorID
ProfessorID FirstName LastName Email
FirstName FirstName
LastName LastName
Email Email
Phone Phone

SECTION SECTION
SECTION

Section ID
SectionID SectionID Time Room ID
Time
Time
Room ID
Room ID

ERD Entities become tables

80
CONVERTING AN ERD TO DATABASE DESIGN

PROFESSOR

ProfessorID PROFESSOR
FirstName
LastName ProfessorID FirstName LastName Email
Email
Phone 111 Kennen Kelley KKelley@bu.edu

SECTION
SECTION

SectionID SectionID ProfessorID Time Room ID


ProfessorID*
Time QM111 111 11am 225
Room ID

Adding Foreign Keys to Database Design

81
ERD VS DATABASE

In ERD, it is perfectly acceptable to have a many-to-many relationship, for


example:

STUDENT SECTION

Student ID Enrolls / Is Enrolled By Section ID


FirstName Time
LastName Room ID

A student enrolls in one or more sections, and a section is enrolled by zero or more students

82
ERD VS DATABASE

● However, in database design, many-to-many relationships are not allowed:


only one-to-many

● Instead, an intermediary table must be created

● The intermediary table will have a one-to-many relationship with both


entities

83
ERD VS DATABASE

STUDENT Section

Student_ID LastName FirstName Section_ID Section_ID Room ID Time

U345761298 Bond James IS223 IS223 228 2:00

U345761298 Bond James LA245 LA245 224 12:30

U987349876 Bjergson Soren LA245 SM221 101 10:00

U871237673 Johnson Peter SM221

U871237673 Johnson Peter IS223


FK

Databases don’t allow many-to-many relationships

What if we did not have an intermediary table?

84
ERD VS DATABASE: THE INTERMEDIARY TABLE

STUDENT ENROLL SECTION

Student_ID LastName FirstName Student_ID Section_ID Section_ID Room ID Time

U345761298 Bond James U345761298 IS223 IS223 228 2:00

U987349876 Bjergson Soren U345761298 LA245 LA245 224 12:30

U871237673 Johnson Peter U345761298 SM221 SM221 101 10:00


U987349876 IS223

U987349876 LA245

U987349876 SM221

U871237673 IS223

U871237673 LA245

Many-to-Many implementation in database design

85
ERD VS DATABASE

86
86
ERD VS DATABASE

87
87
ERD VS DATABASE: THE INTERMEDIARY TABLE

88
88
ERD VS DATABASE

STUDENT
Student ID
Last Name
First Name

Enrolls in/Contain

PROFESSOR
SECTION CLASSROOM
Professor ID
FirstName Taught by Section ID Is taught in Room ID
LastName Time Room Number
Email RoomID Room Capacity
Phone

Sample ERD Diagram with Cardinality

89
ERD VS DATABASE: THE INTERMEDIARY TABLE

Intermediary table

STUDENT ENROLL SECTION


1 ∞ 1
Section ID
Student ID
Student ID ∞ Professor ID
Last Name
Section ID Time
First Name
Room ID

90
ERD VS DATABASE: THE INTERMEDIARY TABLE

STUDENT ENROLL
1 ∞
Student ID Student ID

Last Name Section ID
First Name Semester

PROFESSOR SECTION ClassROOM


1 1
ProfessorID Section ID
FirstName ∞ 1
Professor ID Room ID
LastName Time Room Number
Email ∞ Room Capacity
Room ID
Phone

Example Finalized Database Design

91
Exercise: Fitness First Database Design

BUSS215 © Jiye BAEK 92


TAKE-AWAYS

▊ Data models (ERD) are essential to effective database design

▊ Datamodels (ERD) are used to specify the entities and relationships of


the database.

93
93
TAKE-AWAYS

▊ Datamodels must accurately represent the business rules and


requirements of the organization or process.

▊ Thiscan’t be left purely to the technical staff! Business people have a


real stake in being involved.

▊ Effective
queries and reports require that the correct data model be in
place and instantiated in the database application.

94
94

You might also like