Version 4 (modified by 6 weeks ago) ( diff ) | ,
---|
ER Diagram
Data Requirements
Entities
- Entity: Admin
- Description: An entity that disjointly specializes from the
Account
entity and uniquely identifies administrators of the system. - Primary Key:
email
- Entered when creating the account. - Attributes:
- Description: An entity that disjointly specializes from the
- Entity: Vehicle
- Description: Generalization entity for all means of transport available on the system.
- Primary Key:
plate_num
- The registration/plate number of the vehicle. - Candidate Key: Composite key of
brand
andmodel
(not used sinceplate_num
is a superkey). - Attributes:
model
: The specific model of the vehicle.brand
: The manufacturer of the vehicle.capacity
: The seating capacity of the vehicle.
- Entity: Trip
- Description: A weak entity representing an instance of a route, used to check information about tickets purchased for a route.
- Partial Key:
trip_id
- An artificial ID of a trip. - Attributes:
status
: The state of the trip (e.g.,completed
,cancelled
,in progress
).
- Entity: Review
- Description: A weak entity describing user ratings for a trip.
- Partial Key:
review_id
- An artificial ID for the review. - Attributes:
description
: User-provided context about the trip.rating
: An integer rating (out of 5).
- Entity: Ticket
- Description: Allows a user (
Account
) to reserve a place on a route. - Primary Key:
ticket_id
- An artificial ID for the ticket. - Attributes:
price
: The base price for the ticket.date_purchased
: The date the ticket was purchased.seat
: Derived attribute (calculated ascapacity - free_seats
).
- Description: Allows a user (
- Entity: Automobile
- Description: A disjoint specialization of the
Vehicle
entity, identifying cars. - Primary Key:
plate_num
. - Attributes:
- Description: A disjoint specialization of the
- Entity: Bus
- Description: A disjoint specialization of the
Vehicle
entity, identifying buses. - Primary Key:
plate_num
. - Attributes:
- Description: A disjoint specialization of the
- Entity: Train
- Description: A disjoint specialization of the
Vehicle
entity, identifying trains. - Primary Key:
plate_num
. - Attributes:
- Description: A disjoint specialization of the
- Entity: Van
- Description: A disjoint specialization of the
Vehicle
entity, identifying vans. - Primary Key:
plate_num
. - Attributes:
- Description: A disjoint specialization of the
- Entity: Route
- Description: Describes a scheduled/frequent route between two or more places.
- Primary Key:
id
- An artificial ID for the route. - Attributes:
date
: Scheduled date(s) for the route.free_seats
: Derived attribute indicating available seats.
- Entity: Child Ticket
- Description: A disjoint specialization of the
Ticket
entity for passengers below a certain age. - Primary Key:
ticket_id
. - Attributes:
price
purchase_date
discount
SSN
parent_SSN
- Description: A disjoint specialization of the
- Entity: One-Way Ticket
- Description: A disjoint specialization of the
Ticket
entity for one-direction travel. - Primary Key:
ticket_id
. - Attributes:
price
purchase_date
- Description: A disjoint specialization of the
- Entity: Two-Way Ticket
- Description: A disjoint specialization of the
Ticket
entity for round-trip travel. - Primary Key:
ticket_id
. - Attributes:
expiration_period
: Time the ticket is valid.purchase_date
price
expiration_date
: Derived attribute (purchase_date + expiration_period
).
- Description: A disjoint specialization of the
- Entity: Account
- Description: Contains main information about application users.
- Primary Key:
email
. - Attributes:
name
surname
password
university
: Where the student studies.student_index
- Entity: Transport Organizer
- Description: A disjoint specialization of the
Account
entity for managing trips and schedules. - Primary Key:
email
. - Attributes:
name
surname
password
company_name
company_CIN
- Description: A disjoint specialization of the
- Entity: Driver
- Description: A disjoint specialization of the
Account
entity for individuals responsible for vehicle operation. - Primary Key:
email
. - Attributes:
name
surname
password
- Description: A disjoint specialization of the
- Entity: Student
- Description: A disjoint specialization of the
Account
entity for students enrolled at Macedonian universities. - Primary Key:
email
. - Attributes:
name
surname
password
university
- Description: A disjoint specialization of the
- Entity: Favorite
- Description: A weak entity representing a user's favorite routes.
- Primary Key: Composite key (
email
, partial key for each favorite route). - Attributes:
- Entity: Location
- Description: Contains geographical points for route stops (along the way or final destinations).
- Primary Key: Composite key (
latitude
,longitude
). - Attributes:
time
: Estimated arrival time.name
: Descriptive local names.
- Entity: Payment
- Description: A weak entity describing the process of purchasing tickets.
- Partial Key: artificial ID
payment_id
. - Attributes:
date
num_tickets
total_price
: Derived attribute.
Relationships
- makes: 1:N Relation between
Account
andPayment
.- Description: Tells which payment was made by which account and is used as an identifying relation for a payment.
- leaves_a: 1:N Relation between
Account
andReview
.- Description: Tells which review was left by which user. This relation identifies the entity
Review
.
- Description: Tells which review was left by which user. This relation identifies the entity
- adds: 1:N Relation between
Account
andFavorite
.- Description: Tells which account added which route to favorites. This relation identifies the entity
Favorite
.
- Description: Tells which account added which route to favorites. This relation identifies the entity
- for_ticket: 1:N Relation between
Payment
andTicket
.- Description: Tells which payment was made for which ticket.
- works_for: 1:N Relation between
Transport Organizer
andDriver
.- Description: Tells which driver works for which transport organizer.
- on: 1:N Relation between
Review
andTrip
.- Description: Tells which review was left on which trip. This relation identifies the entity
Review
.
- Description: Tells which review was left on which trip. This relation identifies the entity
- organizes: 1:N Relation between
Transport Organizer
andRoute
.- Description: Tells which transport organizer organized which route.
- is_a: 1:N Relation between
Route
andFavorite
.- Description: Tells which route is favorited by which account. This relation identifies the entity
Favorite
.
- Description: Tells which route is favorited by which account. This relation identifies the entity
- for: 1:N Relation between
Route
andTrip
.- Description: Tells which route was made for which trip. This relation identifies the entity
Trip
.
- Description: Tells which route was made for which trip. This relation identifies the entity
- on: 1:N Relation between
Route
andOne-Way Ticket
.- Description: Tells which route was bought by which one-way tickets.
- back: 1:N Relation between
Route
andTwo-Way Ticket
.- Description: Tells which route was purchased as part of a two-way ticket for the return journey.
- forward: 1:N Relation between
Route
andTwo-Way Ticket
.- Description: Tells which route was purchased as part of a two-way ticket for the outbound journey.
- owns: 1:N Relation between
Transport Organizer
andVehicle
.- Description: Tells which transport organizer owns which vehicle.
- stops_at: N:M Relation between
Route
andLocation
.- Description: Tells which locations are included as stops on specific routes.
- operates: N:M Relation between
Driver
andVehicle
.- Description: Tells which vehicles are operated by which drivers.
- uses: N:M Relation between
Route
andVehicle
.- Description: Tells which vehicles are used on which routes.
- drives_on: N:M Relation between
Route
andDriver
.- Description: Tells which drivers drive on which routes.
- lists: N:M Relation between
Account
andTrip
.- Description: Tells which account has been on which trips.
Attachments (4)
- ERModel_RouteMK.png (204.1 KB ) - added by 5 weeks ago.
- er-model-routemk_final.png (202.6 KB ) - added by 4 weeks ago.
- er-model-routemk_final.2.png (200.4 KB ) - added by 4 weeks ago.
- er-model-routemk_final3.png (207.0 KB ) - added by 6 days ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.