

create table Member_JT
	(id             integer
		        primary key,
	 memberNr       integer, 	
	 password       varchar(15), 
	 homeLocation   integer
                        references Location(id)); 

create table CoopMember_JT
	(id             integer
		        primary key
			references Member_JT(id) on delete cascade,
	 person         integer,
	 shares         numeric(8,2), 
	 responsibleFor integer
                        references Location(id)); 

create table CarSharingMember_JT  
	(id             integer
		        primary key
			references Member_JT(id) on delete cascade);

create table PersonMember_JT
	(id             integer
		        primary key
			references CarSharingMember_JT(id) on delete cascade,
	 person         integer,
	 hadAccident    boolean); 

create table CompanyMember_JT 
	(id             integer
		        primary key
			references CarSharingMember_JT(id) on delete cascade,
	 company        integer);

create table Vehicle_JT
	(id             integer
		        primary key,
	 licensePlate   varchar(10), 	
	 make           varchar(15), 
	 model          varchar(15), 
	 motorNumber    varchar(20), 
	 kilometers     kilometerT, 
	 isOperational  boolean, 
	 operationStart Date, 
	 lastService    Date, 
	 gasConsumption LiterT, 
	 insurance      InsurancePolicyT, 
	 home           integer 
	                references Location(id)
	) ;

create table MotorCar_JT
	(id             integer
		        primary key
			references Vehicle_JT(id) on delete cascade,
	 childSeat      boolean, 
	 extras         varchar(100)
        ); 

create table Truck_JT
	(id             integer
		        primary key
			references Vehicle_JT(id) on delete cascade,
	 loadingCapacity smallint
        );

create table CompactCar_JT
	(id             integer
		        primary key
			references MotorCar_JT(id) on delete cascade
        );

create table Convertible_JT
	(id             integer
		        primary key
			references MotorCar_JT(id) on delete cascade,
	 backseat       boolean
        );   

create table Limousine_JT
	(id             integer
		        primary key
			references MotorCar_JT(id) on delete cascade
        );

create table Sedan_JT
	(id             integer
		        primary key
			references MotorCar_JT(id) on delete cascade
        );

create table StationWagon_JT
	(id             integer
		        primary key
			references MotorCar_JT(id) on delete cascade,
	 loadingVolume  smallint
        );

create table Van_JT
	(id             integer
		        primary key
			references MotorCar_JT(id) on delete cascade,
	 numberOfSeats  smallint   
        );

create table Pickup_JT
	(id             integer
		        primary key
			references Truck_JT(id) on delete cascade
        );

create table Transporter_JT
	(id             integer
		        primary key
			references Truck_JT(id) on delete cascade,
	 height         smallint   
        );

