0% found this document useful (0 votes)
15 views68 pages

Suggested Solution of ERD Advanced Practices

sadad

Uploaded by

YouTubeATP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views68 pages

Suggested Solution of ERD Advanced Practices

sadad

Uploaded by

YouTubeATP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 68

Hello!

This is Kit :)
@ COMP3278
Introduction to Database Management Systems
Let me share with you how I
create the ERD for the question,
and the process of thinking when I
am working on this question 

2
Cinemas

Question 1
The system
should show a
list of Cinemas

3
tel
address

photo
Cinemas
name

After a user selects a cinema, the Cinema


name, Photo, Address, Tel, and a List of
movies currently shown in the cinema will
be display.

4
tel
address

photo
Cinemas shows Movies
name

The list of movies can be modeled as a


relationship between the Cinemas entity
set and Movies entity set.

5
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre

name length

For each Movie in the movie list, we


show the Poster, Movie name, Genre,
Opening Date, Class and Length.

As an example, we have the following


information for the first movie in the
movie list of cinema “HOLLYWOOD”.

Poster SPIDER-MAN_NO_WAY_HOME_1.png
Movie name Spider-man: No Way Home
Genre Action / Adventure
Opening Date 2021-12-17
Length 148
6
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre

name length

has

houseID
Houses
Each Cinema has a number of Houses. The
houses in a cinema are numbered with a
houseID that is unique within a cinema.

7
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre

name length

has has

houseID
Show
Houses
records

showRecordID
price daytime
type

Each movie has a number of Show record(s).


Each show record has its Daytime, HouseID,
Type (2D/3D/IMAX 3D) and ticket Price.
8
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre

name length

has has

houseID
Show
Houses in
records

showRecordID
price daytime
type

The houseID in a show


record is a relationship
with the House entity.
9
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre

name length

has has

houseID
Show
Houses in
records

floorPlan
showRecordID
price daytime
type

Users can select a show record of a movie from a


drop-down list and click the “Ticketing” button to
display the seating plan of the house showing the
movie. 10
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre

name length

has has

houseID
Show
Houses in
records
floorPlan
showRecordID
price daytime
has
type

Each Seat within a house has a seat number, which is a


Seats combination of a row number represented by a character, and
a column number represented by a number.
seatNumber As an example, the seat number of the seat in the bottom left
corner is “I,1”, the seat number of the seat in the top right
row col corner is “A,30”. 11
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber
The system keeps track of the Bookings made by Customers.
row Those seats that are already booked will be marked as “X”. 12
col
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber
Now let’s transform the ERD to relational tables! 
row col 13
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: None

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: None

Show records(showRecordID, type, price, daytime)


Foreign key: None

Customers(customerID)
Foreign key: None
We first create tables for the Entity sets.
For weak entity sets, we get the primary
Bookings(bookingID)
key of the identifying string entity set to
Foreign key: None
form their primary key.

14
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 15
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: None

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: None

Show records(showRecordID, type, price, daytime)


Foreign key: None
For relationship set, we better use meaningful name so that other will
Customers(customerID) understand the meaning of the table.
Foreign key: None Note that name is a foreign key because it is taken from the Cinemas table.
Database will make sure the name stored in CinemasShowsMoves table
Bookings(bookingID) appears in the name column of the Cinemas table. The same for movieID.
Foreign key: None

CinemasShowsMovies (name, movieID)


16
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 17
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: None

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: None

Show records(showRecordID, type, price, daytime, movieID)


Foreign key: movieID references Movies(movieID)

Customers(customerID) The has relationship set highlighted in previous slide


Foreign key: None is a “one-to-many” relationship set, we don’t need an
extra table.
Bookings(bookingID) The movieID in Show records table captures which
Foreign key: None movie the show record is showing.
CinemasShowsMovies (name, movieID)
18
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 19
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: None

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: None

Show records(showRecordID, type, price, daytime, movieID, name, houseID)


Foreign key: movieID references Movies(movieID) ; (name, houseID) references Houses(name, houseID)

Customers(customerID)
Foreign key: None

Bookings(bookingID)
Foreign key: None

CinemasShowsMovies (name, movieID)


20
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 21
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: name references Cinemas(name)

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: None

Show records(showRecordID, type, price, daytime, movieID, name, houseID)


Foreign key: movieID references Movies(movieID) ; (name, houseID) references Houses(name, houseID)

Customers(customerID)
Foreign key: None

Bookings(bookingID)
Foreign key: None

CinemasShowsMovies (name, movieID)


22
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 23
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: name references Cinemas(name)

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: (name,houseID) references Houses(name, houseID)

Show records(showRecordID, type, price, daytime, movieID, name, houseID)


Foreign key: movieID references Movies(movieID) ; (name, houseID) references Houses(name, houseID)

Customers(customerID) It is more precise to say


Foreign key: None (name,houseID) references Houses(name, houseID)
Instead of
Bookings(bookingID) (name) references Cinemas(name)
(houseID) references Houses(houseID)
Foreign key: None Do you know why ?
CinemasShowsMovies (name, movieID)
24
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 25
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: name references Cinemas(name)

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: (name,houseID) references Houses(name, houseID)

Show records(showRecordID, type, price, daytime, movieID, name, houseID)


Foreign key: movieID references Movies(movieID) ; (name, houseID) references Houses(name, houseID)

Customers(customerID)
Foreign key: None

Bookings(bookingID, customerID)
Foreign key: customerID reference Customers(customerID)

CinemasShowsMovies (name, movieID)


26
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 27
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None

Houses(name, houseID, floorPlan)


Foreign key: name references Cinemas(name)

Seats(name, houseID, seatNumber.row, seatNumber.col)


Foreign key: (name,houseID) references Houses(name, houseID)

Show records(showRecordID, type, price, daytime, movieID, name, houseID)


Foreign key: movieID references Movies(movieID) ; (name, houseID) references Houses(name, houseID)

Customers(customerID)
Foreign key: None

Bookings(bookingID, customerID, showRecordID)


Foreign key: customerID reference Customers(customerID) ; showRecordID references Show records (showRecordID)

CinemasShowsMovies (name, movieID)


28
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
tel poster name day
address movieID month
openDate
year
photo
Cinemas shows Movies genre
Customers
name length
customerID
has has
makes
houseID
Show
Houses in books Bookings
records
floorPlan
showRecordID bookingID
price daytime
has
type

Seats books
seatNumber

row col 29
Cinemas(name, photo, address, tel)
Foreign key: None

Movies(movieID, poster, name, openDate.day, openDate.month, openDate.year, genre, length)


Foreign key: None As you can see, referencing a unique seat
requires 4 columns (name, houseID,
Houses(name, houseID, floorPlan) seatNumber.row, seatNumber.col), which could
Foreign key: name references Cinemas(name) be too bulky.
Therefore, some DB designers will use a unique
Seats(name, houseID, seatNumber.row, seatNumber.col)
seatID that is maintained internally by DB for
Foreign key: (name,houseID) references Houses(name, houseID) easy referencing.
Show records(showRecordID, type, price, daytime, movieID, name, houseID)
Foreign key: movieID references Movies(movieID) ; (name, houseID) references Houses(name, houseID)

Customers(customerID)
Foreign key: None

Bookings(bookingID, customerID, showRecordID, name, houseID, seatNumber.row, seatNumber.col)


Foreign key: customerID reference Customers(customerID) ; showRecordID references Show records (showRecordID) ;
(name, houseID, seatNumber.row, seatNumber.col) references Seats (name, houseID, seatNumber.row, seatNumber.col)
CinemasShowsMovies (name, movieID)
30
Foreign key: name references Cinemas (name) ; movieID references Movies(movieID)
Researcher

Question 2
The system should
show a list of
Researcheres

31
researcherID

researcherName Researcher

ISA

industrial institutional
Researcher Researcher

Each researcher has a researcherID


(unique identifier) and a
researcherName.
A researcher can be an institutional
researcher or an industrial researcher.
32
researcherID

researcherName Researcher

ISA

industrial institutional
Researcher Researcher

company researcherTitle institution

For institutional researchers, we


record their researcherTitle and the
institution they work at.
For industrial researchers, we record
the company that they work at.
33
researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA

industrial institutional
Researcher Researcher

company researcherTitle institution

Publications can be modeled as a relationship


between the Researchers entity set and Papers
entity set.
Each researcher may publish zero or many
papers.
Each paper is authored by one or multiple
researcher(s).
34
researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


cites
industrial institutional
Researcher Researcher

company researcherTitle institution

A paper has zero or several citation(s),


citing other papers

35
researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

A paper is reviewed by one or several


institutional researcher(s).
The report of each review has to be stored in
the database.

36
Each researcher is expert in one or
several research area(s).
Each paper is addressing one or
several research area(s).
areaName
Research
area
areaID
expertizes
addresses
in
researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution 37


A research area maybe a sub-research area
of another research area.
A research area has zero or several sub-
research area(s).
has
Sub area Main area
areaName
Research
area
areaID
expertizes
addresses
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution 38


Each paper is published at one conference.
Each conference focuses on a single
research area or a set of research area(s).

has
Sub area Main area
areaName
Research focuses
Conference
area on
areaID
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution 39


Each conference has a conferenceID
(unique identifier) and a conferenceName.
Each conference has a date (day, month,
year) on which the conference is held.
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution 40


Now let’s transform the ERD to relational tables! 

conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution 41


Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None

42
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

43
Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None
5 IndustrialResearcher researcherID, company
Foreign key: researcherID referencing Researcher(researcherID)
6 InstitutionalResearcher researcherID, researcherTitle, institution
Foreign key: researcherID referencing Researcher(researcherID)

44
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

45
Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None
5 IndustrialResearcher researcherID, company
Foreign key: researcherID referencing Researcher(researcherID)
6 InstitutionalResearcher researcherID, researcherTitle, institution
Foreign key: researcherID referencing Researcher(researcherID)
7 ConferenceFocusOnResearchArea conferenceID, areaID
Foreign key: conferenceID references Conference(conferenceID)
areaID references ResearchArea(areaID)

46
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

47
Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None
5 IndustrialResearcher researcherID, company
Foreign key: researcherID referencing Researcher(researcherID)
6 InstitutionalResearcher researcherID, researcherTitle, institution
Foreign key: researcherID referencing Researcher(researcherID)
7 ConferenceFocusOnResearchArea conferenceID, areaID
Foreign key: conferenceID references Conference(conferenceID)
areaID references ResearchArea(areaID)
8 PaperAddressResearchArea conferenceID, paperID, areaID
Foreign key: (conferenceID, paperID) references Paper(conferenceID,paperID)
areaID references ResearchArea(areaID)

48
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

49
Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None
5 IndustrialResearcher researcherID, company
Foreign key: researcherID referencing Researcher(researcherID)
6 InstitutionalResearcher researcherID, researcherTitle, institution
Foreign key: researcherID referencing Researcher(researcherID)
7 ConferenceFocusOnResearchArea conferenceID, areaID
Foreign key: conferenceID references Conference(conferenceID)
areaID references ResearchArea(areaID)
8 PaperAddressResearchArea conferenceID, paperID, areaID
Foreign key: (conferenceID, paperID) references Paper(conferenceID,paperID)
areaID references ResearchArea(areaID)
9 ResearcherExpertizesInResearchArea researcherID, areaID
Foreign key: researcherID references Researcher(researcherID)
areaID references ResearchArea(areaID)

50
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

51
Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None
5 IndustrialResearcher researcherID, company
Foreign key: researcherID referencing Researcher(researcherID)
6 InstitutionalResearcher researcherID, researcherTitle, institution
Foreign key: researcherID referencing Researcher(researcherID)
7 ConferenceFocusOnResearchArea conferenceID, areaID
Foreign key: conferenceID references Conference(conferenceID)
areaID references ResearchArea(areaID)
8 PaperAddressResearchArea conferenceID, paperID, areaID
Foreign key: (conferenceID, paperID) references Paper(conferenceID,paperID)
areaID references ResearchArea(areaID)
9 ResearcherExpertizesInResearchArea researcherID, areaID
Foreign key: researcherID references Researcher(researcherID)
areaID references ResearchArea(areaID)
10 ResearcherPublishesPaper researcherID, conferenceID, paperID
Foreign key: researcherID references Researcher(researcherID)
(conferenceID, paperID) references Paper(conferenceID,paperID)

52
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

53
Table columns
1 Conference conferenceID, conferenceName, date.day, date.month, date.year
Foreign key: None
2 Paper conferenceID, paperID, paperTitle
Foreign key: conferenceID references Conference(conferenceID)
3 Researcher researcherID, researcherName
Foreign key: None
4 ResearchArea areaID, areaName
Foreign key: None
5 IndustrialResearcher researcherID, company
Foreign key: researcherID referencing Researcher(researcherID)
6 InstitutionalResearcher researcherID, researcherTitle, institution
Foreign key: researcherID referencing Researcher(researcherID)
7 ConferenceFocusOnResearchArea conferenceID, areaID
Foreign key: conferenceID references Conference(conferenceID)
areaID references ResearchArea(areaID)
8 PaperAddressResearchArea conferenceID, paperID, areaID
Foreign key: (conferenceID, paperID) references Paper(conferenceID,paperID)
areaID references ResearchArea(areaID)
9 ResearcherExpertizesInResearchArea researcherID, areaID
Foreign key: researcherID references Researcher(researcherID)
areaID references ResearchArea(areaID)
10 ResearcherPublishesPaper researcherID, conferenceID, paperID
Foreign key: researcherID references Researcher(researcherID)
(conferenceID, paperID) references Paper(conferenceID,paperID)
11 InstitutionalResearcherReviewsPaper researcherID, conferenceID, paperID, report
Foreign key: researcherID references InstitutionalResearcher(researcherID)
(conferenceID, paperID) references Paper(conferenceID,paperID)

54
conference
has conferenceID
Name
Sub area Main area day
areaName
Research focuses
Conference date month
area on
areaID
year
expertizes
addresses publishes
in

researcherID paperID

researcherName Researcher publishes Paper


paperTitle

ISA Referrer Referee


reviews
cites
industrial institutional
Researcher Researcher report

company researcherTitle institution

55
Table columns
12 MainAreaHasSubArea mainArea.areaID, subArea.areaID
Foreign key: mainArea.areaID references ResearchArea(areaID)
subArea.areaID references ResearchArea(areaID)
13 PaperCitesPaper referrer.conferenceID, referrer.paperID, referee.ConferenceID, referee.PaperID
Foreign key: (referrer.conferenceID, referrer.paperID) references Paper(conferenceID,paperID)
(referee.ConferenceID, referee.PaperID) references Paper(conferenceID,paperID)

56
userID name

balance

User

Each user consists of a


unique userID and usesr
name and account balance.

Question 3
userID name

balance

friend User

The system stores friendlist information for


each user.
Each user can be friend with many other users.
userID name

balance

friend User

transactionID
amount
date

make Transaction

User can make Transactions.


Each transaction consists of a unique
transactionID, date and amount.
userID name

balance

friend User

transactionID
amount
date

make Transaction

Each transaction is specialized to either ISA disjoint


P2P transfer or Payment (but not both).

P2P transfer Payment


userID name merchantID name

balance

friend User Merchant

transactionID
amount
date

The system stores information of its make Transaction


Merchants.
Each merchant consists of a unique
merchantID and name. ISA disjoint

P2P transfer Payment


userID name merchantID name

balance

friend User Merchant has

transactionID
amount
date
Each merchant can have zero or many location
MobileSpots.
make Transaction
Each MobileSpot consists of spotID and
location of the spot. MobileSpot
SpotID is unique within a merchant only. ISA disjoint
spotId
P2P transfer Payment
userID name merchantID name

balance

friend User Merchant has

transactionID
amount
date
location

make Transaction
Each payment transaction must be made MobileSpot
to one mobile spot.
The system allows a new mobile spot to ISA disjoint
have no payment transactions made. spotId
P2P transfer Payment

paymentTo
userID name merchantID name

balance

friend User Merchant has

transactionID
amount
date
Each P2P transaction must location
transfer to one user. make Transaction
The system allows a user to
have no P2P transactions MobileSpot
transferred to that user. ISA disjoint
spotId
transfer to P2P transfer Payment

paymentTo
userID name merchantID name

cardInfo

friend User Merchant has

transactionID
amount
date
create location

make Transaction
envelopeId MobileSpot

ISA disjoint
Red envelope
spotId
transfer to P2P transfer Payment
amount

A user can create none or many Red Envelopes.


Each red envelope consists of an amount, and an paymentTo
envelopeID which is unique for each user only.
userID name Red envelope is receivedname
merchantID through P2P
transfer. Each red envelope can be
balance
received through one P2P transfer that are
friend User
transferred toMerchant
receipt (another user)
has .

transactionID
amount
date
create location

make Transaction
envelopeId MobileSpot

ISA disjoint
Red envelope
spotId
transfer to P2P transfer Payment
amount

receivedThrough paymentTo
userID name merchantID name

cardInfo

friend User Merchant has

transactionID
amount
date
create location

make Transaction
envelopeId MobileSpot

ISA disjoint
Red envelope
spotId
transfer to P2P transfer Payment
balance

receivedThrough paymentTo
End :)
Feel free to contact Kit ([email protected]) and our TAs if you need help.
68
We are always happy to answer your questions! :-)

You might also like