51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
|
Table Customer {
|
||
|
cid integer [primary key, not null]
|
||
|
firstname varchar [primary key, not null]
|
||
|
lastname varchar [primary key, not null]
|
||
|
preference_vcid integer [Ref: > VehicleClass.vcid, not null]
|
||
|
preference_vcname varchar [Ref: > VehicleClass.vcname, not null]
|
||
|
}
|
||
|
|
||
|
Table VehicleClass {
|
||
|
vcid integer [primary key, not null]
|
||
|
vcname varchar [primary key, not null]
|
||
|
length integer [not null]
|
||
|
width integer [not null]
|
||
|
height integer [not null]
|
||
|
}
|
||
|
|
||
|
Table Vehicle {
|
||
|
vid integer [primary key, not null]
|
||
|
vcid integer [primary key, ref: > VehicleClass.vcid, not null]
|
||
|
vcname varchar [primary key, ref: > VehicleClass.vcname, not null]
|
||
|
last_check_date datetime [not null]
|
||
|
plate_num integer [null]
|
||
|
street varchar [primary key, not null, ref: > Station.street]
|
||
|
postcode varchar [primary key, not null, ref: > Station.postcode]
|
||
|
city varchar [primary key, not null, ref: > Station.city]
|
||
|
name varchar [primary key, not null, ref: > Station.name]
|
||
|
}
|
||
|
|
||
|
Table Station {
|
||
|
street varchar [primary key, not null]
|
||
|
postcode varchar [primary key, not null]
|
||
|
city varchar [primary key, not null]
|
||
|
name varchar [primary key, not null]
|
||
|
}
|
||
|
|
||
|
Table Reservation {
|
||
|
startDateTime datetime [primary key, not null]
|
||
|
endDateTime datetime [not null]
|
||
|
frid integer [null, ref: > FinishedReservation.frid]
|
||
|
cid integer [primary key, not null, ref: > Customer.cid]
|
||
|
cname varchar [primary key, not null, ref: > Customer.firstname]
|
||
|
vid integer [primary key, not null, ref: > Vehicle.vid]
|
||
|
}
|
||
|
|
||
|
Table FinishedReservation {
|
||
|
frid integer [primary key, not null]
|
||
|
distance integer [not null]
|
||
|
cost integer [not null]
|
||
|
}
|
||
|
|