Introduction to 

Graph Database
!

Eric C.Y. LEE

eric@nus.edu.sg

eric@eric.lv

National University of Singapore
Februar...
Outline
•

Relational Database v.s. Graph Database

•

Design the Database in Graph Architecture

•

Basic Usage of Neo4j
...
Relational Database
•

Based on table schema.
•

Field -> Record -> Table -> Database

•

Query by SQL syntax.

•

Open so...
Graph Database
•

Schema-less, based on graph theory.

•

Only two types of data inside the graph database.
•

Node and re...
Modelling a K-pop Database

All materials for database construction, 

we can find in these wikipedia pages.

!5
The information I want to
provide.
•

Team member profiles
•

•

Group, Name, Birth Place,Birth Year, Birth Month

Released...
K-Pop Profiles in Table View
Group
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
KARA
KARA
KARA
KARA

Name
Taeyeon
Jessica
S...
K-Pop Albums in Table View
Group

Title

Released Year

Number of sales

SNSD

Girls’ Generation

2007

284994

SNSD

Oh

...
Group
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
SNSD
KARA
KARA
KARA
KARA

SNSD
KARA

Name
Taeyeon
Jessica
Sunny
Tiffany
Hyoy...
Group

Title

Released Year

Number of sales

SNSD

Girls’ Generation

2007

284994

SNSD

Oh

2010

406662

SNSD

The Boy...
Graph Modelling

!11
Neo4j
1. Download latest version 2.0.1 from www.neo4j.org
2. Cross-platform, Java 1.7 is required.
3. Extract the compress...
Default Web Console
Query Statement Input

Query Result Area
Web Admin Interface
•

URL localhost:7474/webadmin/

!14
Allow Remote Connection
•

Modify configuration file. 

(/neo4j-root/conf/neo4j-server.properties)

•

Uncomment #org.neo4j....
Cypher
•

Basic statement: MATCH, CREATE, WHERE,
RETURN

•

Inspired by “ASCII Art”.




MATCH (singer)-[:BIRTH_PLACE]->(c...
Cypher of Example
•

Create the Nodes
•

Singer

CREATE (n:Singer {name:”Taeyeon”})

CREATE (n:Singer {name:”Jessica”})

C...
Cypher of Example
•

Create the Nodes
•

Album


•

CREATE (n:Album {name:”Girl’s Generation”,
sales: “284994”})

CREATE (...
Cypher of Example
•

Create Relationships
•

Group and Members [:HAS_MEMBER]

MATCH (snsd:Group{name:”SNSD”}), (taeyeon:Si...
Cypher of Example
•

Create Relationships
•

Group and Members [:HAS_MEMBER]

MATCH (kara:Group{name:”KARA”}),
(gyuri:Sing...
Cypher of Example
•

Create Relationships
Albums and Released Year [:RELEASED_YEAR]

MATCH (y2007:Year{year:”2007”}), 

(y...
Cypher of Example
•

Create Relationships
•

Group and Albums [:HAS_ALBUM]

MATCH (kara:Group{name:”KARA”}), 

(snsd:Group...
Cypher of Example
•

Create Relationships
Singer and Country [:BIRTH_PLACE]

MATCH (korea:Country{name:”Korea”}), 

(gyuri...
Cypher of Example
•

Create Relationships
Singer and Country [:BIRTH_PLACE]

MATCH (usa:Country{name:”USA”}), 

(jessica:S...
Cypher of Example
•

Create Relationships
Singer and Birth Year [:BIRTH_YEAR]

MATCH (y1988:Year{Year:”1988”}),(y1989:Year...
Cypher of Example
•

Create Relationships
Singer and Birth Month [:BIRTH_MONTH]

MATCH (jan:Month{Month:”January”}),(feb:M...
Query Cases
Who is the member of Girl’s Generation(SNSD)?


•




MATCH (snsd{name:”SNSD”})-[:HAS_MEMBER]->(member)

RETUR...
Query Cases
Who is not born in Korea? Who and where.


•




MATCH (singer)-[:BIRTH_PLACE]->(country) 

WHERE NOT country....
Business Application
GENDER_IS
Customer:A
Male

BOUGHT_ALBUM

Customer:B

GENDER_IS

BOUGHT_ALBUM

Integrate a subset grap...
Potential Orders?
Customer:B bought SNSD and KARA’s album, we can promote albums of
T-ARA to him?


•




Both SNSD and KA...
[:HAS_STUDENT]

Person

Name:”TAN TIN WEE”

Occupation: “Professor”

[:HAS_MODULE]
Person

Name:”Eric Lee”

Occupation: “S...
Upcoming SlideShare
Loading in …5
×

Introduction to Graph Database

1,285 views

Published on

Introduction to Graph database, using K-pop as a database modelling case. From the idea of graph database, Neo4j installation, modelling, Cypher to business application.

Published in: Technology
3 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total views
1,285
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
72
Comments
3
Likes
1
Embeds 0
No embeds

No notes for slide

Introduction to Graph Database

  1. 1. Introduction to 
 Graph Database ! Eric C.Y. LEE
 eric@nus.edu.sg
 eric@eric.lv
 National University of Singapore February, 2014
  2. 2. Outline • Relational Database v.s. Graph Database • Design the Database in Graph Architecture • Basic Usage of Neo4j • Cypher Query Language • Business application !2
  3. 3. Relational Database • Based on table schema. • Field -> Record -> Table -> Database • Query by SQL syntax. • Open source and commercial products available. • MySQL, Oracle, PostgreSQL, MS-SQL Server. • LAMP: Linux+Apache+MySQL+PHP !3
  4. 4. Graph Database • Schema-less, based on graph theory. • Only two types of data inside the graph database. • Node and relationship (edge) . • One of the NoSQL database management systems, query by several query languages, depend on database products. • Widely use in social network system and large scale website architecture. !4 Figure Credit: Wikipedia
  5. 5. Modelling a K-pop Database All materials for database construction, 
 we can find in these wikipedia pages. !5
  6. 6. The information I want to provide. • Team member profiles • • Group, Name, Birth Place,Birth Year, Birth Month Released albums • Title, Released Year, Number of Sales !6
  7. 7. K-Pop Profiles in Table View Group SNSD SNSD SNSD SNSD SNSD SNSD SNSD SNSD SNSD KARA KARA KARA KARA Name Taeyeon Jessica Sunny Tiffany Hyoyeon Yuri Sooyoung Yoona Seohyun Gyuri Seungyeon Hara Jiyoung Birth Place Korea U.S.A. U.S.A. U.S.A. Korea Korea Korea Korea Korea Korea Korea Korea Korea !7 Birth Year 1989 1989 1989 1989 1989 1989 1990 1990 1991 1988 1988 1991 1994 Birth Month March April May August September December February May June May July January January Any finding?
  8. 8. K-Pop Albums in Table View Group Title Released Year Number of sales SNSD Girls’ Generation 2007 284994 SNSD Oh 2010 406662 SNSD The Boys 2011 449616 SNSD I GOT A BOY 2013 293302 KARA BLOOMING 2007 50000 KARA REVOLUTION 2009 80000 KARA STEP 2011 100662 KARA FULL BLOOM 2013 46199 !8 Any finding?
  9. 9. Group SNSD SNSD SNSD SNSD SNSD SNSD SNSD SNSD SNSD KARA KARA KARA KARA SNSD KARA Name Taeyeon Jessica Sunny Tiffany Hyoyeon Yuri Sooyoung Yoona Seohyun Gyuri Seungyeon Hara Jiyoung Birth Place Korea U.S.A. U.S.A. U.S.A. Korea Korea Korea Korea Korea Korea Korea Korea Korea U.S.A Korea !9 Birth Year 1989 1989 1989 1989 1989 1989 1990 1990 1991 1988 1988 1991 1994 1988 1989 1990 1991 1994 Birth Month March April May August September December February May June May July January January January February March April September May December June July August
  10. 10. Group Title Released Year Number of sales SNSD Girls’ Generation 2007 284994 SNSD Oh 2010 406662 SNSD The Boys 2011 449616 SNSD I GOT A BOY 2013 293302 KARA BLOOMING 2007 50000 KARA REVOLUTION 2009 80000 KARA STEP 2011 100662 KARA FULL BLOOM 2013 46199 2007 2009 2010 2011 2013 SNSD KARA !10
  11. 11. Graph Modelling !11
  12. 12. Neo4j 1. Download latest version 2.0.1 from www.neo4j.org 2. Cross-platform, Java 1.7 is required. 3. Extract the compressed package, execute main program. 4. Web console: http://localhost:7474 2 1 3 !12 4
  13. 13. Default Web Console Query Statement Input Query Result Area
  14. 14. Web Admin Interface • URL localhost:7474/webadmin/ !14
  15. 15. Allow Remote Connection • Modify configuration file. 
 (/neo4j-root/conf/neo4j-server.properties) • Uncomment #org.neo4j.server.webserver.address=0.0.0.0 !15
  16. 16. Cypher • Basic statement: MATCH, CREATE, WHERE, RETURN • Inspired by “ASCII Art”.
 
 MATCH (singer)-[:BIRTH_PLACE]->(country) 
 RETURN singer, country; singer BIRTH PLACE country (singer)-[:BIRTH_PLACE]->(country) !16
  17. 17. Cypher of Example • Create the Nodes • Singer
 CREATE (n:Singer {name:”Taeyeon”})
 CREATE (n:Singer {name:”Jessica”})
 CREATE (n:Singer {name:”Sunny”})
 CREATE (n:Singer {name:”Tiffany”})
 CREATE (n:Singer {name:”Hyoyeon”})
 CREATE (n:Singer {name:”Yuri”})
 CREATE (n:Singer {name:”Sooyoung”})
 CREATE (n:Singer {name:”Yoona”})
 CREATE (n:Singer {name:”Seohyun”})
 CREATE (n:Singer {name:”Gyuri”})
 CREATE (n:Singer {name:”Seungyeon”})
 CREATE (n:Singer {name:”Hara”})
 CREATE (n:Singer {name:”Jiyoung”})
 !17 • Group
 CREATE (n:Group {name:”SNSD”})
 CREATE (n:Group {name:”KARA”}) • Year
 CREATE (n:Year {year:”1988”})
 CREATE (n:Year {year:”1989”})
 CREATE (n:Year {year:”1990”})
 CREATE (n:Year {year:”1991”})
 CREATE (n:Year {year:”1994”})
 CREATE (n:Year {year:”2007”})
 CREATE (n:Year {year:”2009”})
 CREATE (n:Year {year:”2010”})
 CREATE (n:Year {year:”2011”})
 CREATE (n:Year {year:”2013”})
  18. 18. Cypher of Example • Create the Nodes • Album
 • CREATE (n:Album {name:”Girl’s Generation”, sales: “284994”})
 CREATE (n:Album {name:”Oh”, sales:”406662”})
 CREATE (n:Album {name:”The boys”, sales:”449616”})
 CREATE (n:Album {name:”I got a boy”, sales:”293302”})
 CREATE (n:Album {name:”Blooming”,sales:”50000”})
 CREATE (n:Album {name:”Revolution”,sales:”80000”})
 CREATE (n:Album {name:”STEP”,sales:”100662”})
 CREATE (n:Album {name:”Full Bloom”,sales:”46199”})
 
 !18 Country
 CREATE (n:Country {name:”U.S.A.”})
 CREATE (n:Country {name:”Korea”}) • Month
 CREATE (n:Month {month:”January”})
 CREATE (n:Month {month:”February”})
 CREATE (n:Month {month:”March”})
 CREATE (n:Month {month:”April”})
 CREATE (n:Month {month:”May”})
 CREATE (n:Month {month:”June”})
 CREATE (n:Month {month:”July”})
 CREATE (n:Month {month:”August”})
 CREATE (n:Month {month:”September”})
 CREATE (n:Month {month:”December”})
  19. 19. Cypher of Example • Create Relationships • Group and Members [:HAS_MEMBER]
 MATCH (snsd:Group{name:”SNSD”}), (taeyeon:Singer{name:”Taeyeon”}), (jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}), (tiffany:Singer{name:”Tiffany”}),(hyoyeon:Singer{name:”Hyoyeon”}), (yuri:Singer{name:”Yuri”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”})
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(taeyeon)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(jessica)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(tiffany)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(sunny)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(hyoyeon)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(yuri)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(sooyoung)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(yoona)
 CREATE UNIQUE (snsd)-[:HAS_MEMBER]->(seohyun) !19
  20. 20. Cypher of Example • Create Relationships • Group and Members [:HAS_MEMBER]
 MATCH (kara:Group{name:”KARA”}), (gyuri:Singer{name:”Gyuri”}), (seungyeon:Singer{name:”Seungyeon”}), (hara:Singer{name:”Hara”}), (jiyoung:Singer{name:”Jiyoung”})
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(gyuri)
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(seungyeon)
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(hara)
 CREATE UNIQUE (kara)-[:HAS_MEMBER]->(jiyoung)
 !20
  21. 21. Cypher of Example • Create Relationships Albums and Released Year [:RELEASED_YEAR]
 MATCH (y2007:Year{year:”2007”}), 
 (y2009:Year{year:”2009”}),(y2010:Year{year:”2010”}),(y2011:Year{year:”2011”}), (y2012:Year{year:”2012”}),(y2013:Year{year:”2013”}),
 (album1:Album{name:”Girl’s Generation”}),
 (album2:Album{name:”Oh”}),
 (album3:Album{name:”The boys”}),
 (album4:Album{name:”I got a boy”}),
 (album5:Album{name:”Blooming”}),
 (album6:Album{name:”Revolution”}),
 (album7:Album{name:”STEP”}),
 (album8:Album{name:”Full Bloom”})
 CREATE UNIQUE (album1)-[:RELEASED_YEAR]->(y2007)
 CREATE UNIQUE (album2)-[:RELEASED_YEAR]->(y2010)
 CREATE UNIQUE (album3)-[:RELEASED_YEAR]->(y2011)
 CREATE UNIQUE (album4)-[:RELEASED_YEAR]->(y2013)
 CREATE UNIQUE (album5)-[:RELEASED_YEAR]->(y2007)
 CREATE UNIQUE (album6)-[:RELEASED_YEAR]->(y2009)
 CREATE UNIQUE (album7)-[:RELEASED_YEAR]->(y2011)
 CREATE UNIQUE (album8)-[:RELEASED_YEAR]->(y2013)
 • 
 !21
  22. 22. Cypher of Example • Create Relationships • Group and Albums [:HAS_ALBUM]
 MATCH (kara:Group{name:”KARA”}), 
 (snsd:Group{name:”SNSD”}),
 (album1:Album{name:”Girl’s Generation”}),
 (album2:Album{name:”Oh”}),
 (album3:Album{name:”The boys”}),
 (album4:Album{name:”I got a boy”}),
 (album5:Album{name:”Blooming”}),
 (album6:Album{name:”Revolution”}),
 (album7:Album{name:”STEP”}),
 (album8:Album{name:”Full Bloom”})
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album1)
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album2)
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album3)
 CREATE UNIQUE (snsd)-[:HAS_ALBUM]->(album4)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album5)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album6)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album7)
 CREATE UNIQUE (kara)-[:HAS_ALBUM]->(album8)
 !22
  23. 23. Cypher of Example • Create Relationships Singer and Country [:BIRTH_PLACE]
 MATCH (korea:Country{name:”Korea”}), 
 (gyuri:Singer{name:”Gyuri”}),
 (seungyeon:Singer{name:”Seungyeon”}),
 (hara:Singer{name:”Hara”}),
 (jiyoung:Singer{name:”Jiyoung”}),(taeyeon:Singer{name:”Taeyeon”}), (hyoyeon:Singer{name:”Hyoyeon”}),(yuri:Singer{name:”Yuri”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”})
 • 
 CREATE UNIQUE (gyuri)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (seungyeon)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (hara)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (jiyoung)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (taeyeon)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (hyoyeon)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (yuri)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (sooyoung)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (yoona)-[:BIRTH_PLACE]->(korea)
 CREATE UNIQUE (seohyun)-[:BIRTH_PLACE]->(korea) !23
  24. 24. Cypher of Example • Create Relationships Singer and Country [:BIRTH_PLACE]
 MATCH (usa:Country{name:”USA”}), 
 (jessica:Singer{name:”Jessica”}),
 (tiffany:Singer{name:”Tiffany”}),
 (sunny:Singer{name:”Sunny”})
 • 
 CREATE UNIQUE (jessica)-[:BIRTH_PLACE]->(usa)
 CREATE UNIQUE (tiffany)-[:BIRTH_PLACE]->(usa)
 CREATE UNIQUE (sunny)-[:BIRTH_PLACE]->(usa)
 !24
  25. 25. Cypher of Example • Create Relationships Singer and Birth Year [:BIRTH_YEAR]
 MATCH (y1988:Year{Year:”1988”}),(y1989:Year{Year:”1989”}),(y1990:Year{Year:”1990”}), (y1991:Year{Year:”1991”}), (y1994:Year{Year:”1994”}),
 (gyuri:Singer{name:”Gyuri”}),(seungyeon:Singer{name:”Seungyeon”}),(taeyeon:Singer{name:”Taeyeon”}), (jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),(tiffany:Singer{name:”Tiffany”}), (yuri:Singer{name:”Yuri”}),(hyoyeon:Singer{name:”Hyoyeon”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”}),(hara:Singer{name:”Hara”}), (jiyoung:Singer{name:”Jiyoung”})
 • 
 
 CREATE UNIQUE (gyuri)-[:BIRTH_YEAR]->(y1988)
 CREATE UNIQUE (seungyeon)-[:BIRTH_YEAR]->(y1988)
 CREATE UNIQUE (taeyeon)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (jessica)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (sunny)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (tiffany)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (hyoyeon)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (yuri)-[:BIRTH_YEAR]->(y1989)
 CREATE UNIQUE (sooyoung)-[:BIRTH_YEAR]->(y1990)
 CREATE UNIQUE (yoona)-[:BIRTH_YEAR]->(y1990)
 CREATE UNIQUE (seohyun)-[:BIRTH_YEAR]->(y1991)
 CREATE UNIQUE (hara)-[:BIRTH_YEAR]->(y1991)
 CREATE UNIQUE (jiyoung)-[:BIRTH_YEAR]->(y1994)
 !25
  26. 26. Cypher of Example • Create Relationships Singer and Birth Month [:BIRTH_MONTH]
 MATCH (jan:Month{Month:”January”}),(feb:Month{Month:”February”}),(mar:Month{Month:”March”}), (apr:Month{Month:”April”}), (may:Month{Month:”May”}),(jun:Month{Month:”June”}),(jul:Month{Month:”July”}), (aug:Month{Month:”August”}),(sep:Month{Month:”September”}),(dec:Month{Month:”December”}),
 (gyuri:Singer{name:”Gyuri”}),(seungyeon:Singer{name:”Seungyeon”}),(taeyeon:Singer{name:”Taeyeon”}), (jessica:Singer{name:”Jessica”}),(sunny:Singer{name:”Sunny”}),(tiffany:Singer{name:”Tiffany”}), (yuri:Singer{name:”Yuri”}),(hyoyeon:Singer{name:”Hyoyeon”}),(sooyoung:Singer{name:”Sooyoung”}), (yoona:Singer{name:”Yoona”}),(seohyun:Singer{name:”Seohyun”}),(hara:Singer{name:”Hara”}), (jiyoung:Singer{name:”Jiyoung”})
 • 
 
 CREATE UNIQUE (hara)-[:BIRTH_MONTH]->(jan)
 CREATE UNIQUE (jiyoung)-[:BIRTH_MONTH]->(jan)
 CREATE UNIQUE (sooyoung)-[:BIRTH_MONTH]->(feb)
 CREATE UNIQUE (taeyeon)-[:BIRTH_MONTH]->(mar)
 CREATE UNIQUE (jessica)-[:BIRTH_MONTH]->(apr)
 CREATE UNIQUE (sunny)-[:BIRTH_MONTH]->(may)
 CREATE UNIQUE (yoona)-[:BIRTH_MONTH]->(may)
 CREATE UNIQUE (gyuri)-[:BIRTH_MONTH]->(may)
 CREATE UNIQUE (seohyun)-[:BIRTH_MONTH]->(jun)
 CREATE UNIQUE (seungyeon)-[:BIRTH_MONTH]->(jul)
 CREATE UNIQUE (tiffany)-[:BIRTH_MONTH]->(aug)
 CREATE UNIQUE (hyoyeon)-[:BIRTH_MONTH]->(sep)
 CREATE UNIQUE (yuri)-[:BIRTH_MONTH]->(dec) !26
  27. 27. Query Cases Who is the member of Girl’s Generation(SNSD)?
 • 
 MATCH (snsd{name:”SNSD”})-[:HAS_MEMBER]->(member)
 RETURN member; Who is the youngest member of KARA?
 • 
 MATCH (kara{name:”KARA”})-[:HAS_MEMBER]->(member), (member)-[:BIRTH_YEAR]->(year)
 RETURN member, ORDER BY (year.year) LIMIT 1 ; !27
  28. 28. Query Cases Who is not born in Korea? Who and where.
 • 
 MATCH (singer)-[:BIRTH_PLACE]->(country) 
 WHERE NOT country.name="Korea" 
 RETURN singer, country; Which album is the top selling of SNSD? Show the album name and number.
 • 
 MATCH (Group{name:”SNSD”})-[:HAS_ALBUM]->(albums)
 WITH albums ORDER BY albums.sales DESC
 RETURN albums LIMIT 1; !28
  29. 29. Business Application GENDER_IS Customer:A Male BOUGHT_ALBUM Customer:B GENDER_IS BOUGHT_ALBUM Integrate a subset graph of customer 
 purchase history to the existed K-pop database. !29
  30. 30. Potential Orders? Customer:B bought SNSD and KARA’s album, we can promote albums of T-ARA to him?
 • 
 Both SNSD and KARA are female K-pop groups, T-ARA is female K-pop group too. Give Customer:A price discount, push him buy the album “I GOT A BOY”.
 • 
 SNSD has 4 albums. According to the graph, Customer:A bought the 3 albums from us. He didn’t buy “I GOT A BOY”. Ask male customer buy female K-pop groups’ album is much easier.
 • 
 The database shows most of female K-pop group album buyers are male. !30
  31. 31. [:HAS_STUDENT] Person
 Name:”TAN TIN WEE”
 Occupation: “Professor” [:HAS_MODULE] Person
 Name:”Eric Lee”
 Occupation: “Student” [:HAS_TA] [:HAS_TA] [:SAY] Person
 Name:”Christine Eng”
 Occupation: “Student” [:HAS_STUDENT] Module
 ID:”LSM3241”
 Name:”Bioinformatics and Biocomputing” [:HAS_TA] Person
 Name:”Hu Yongli”
 Occupation: “Student” Sentence
 Sentence:”Thank you!” !31

×