aboutsummaryrefslogtreecommitdiff
path: root/eindopdracht/b5.sql
blob: fa7a5482ca7a68a19463f8585faa0b80031122c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
create table if not exists Land (
	ID int unsigned not null auto_increment,
	Naam varchar(90) not null,
	primary key (ID),
	unique(Naam)
);

create table if not exists Locatie (
	ID int unsigned not null auto_increment,
	LandID int unsigned not null,
	Naam varchar(90) not null,
	primary key (ID),
	foreign key (LandID) references Land(ID),
	unique(Naam)
);

create table if not exists Merk (
	ID int unsigned not null auto_increment,
	Naam varchar(90) not null,
	primary key (ID),
	unique(Naam)
);

create table if not exists Hoofdkantoor (
	ID int unsigned not null auto_increment,
	LocatieID int unsigned not null,
	MerkID int unsigned not null,
	primary key (ID),
	foreign key (LocatieID) references Locatie(ID),
	foreign key (MerkID) references Merk(ID)
);

create table if not exists `Type` (
	ID int unsigned not null auto_increment,
	Naam varchar(90) not null,
	MerkID int unsigned not null,
	Vermogen int unsigned not null,
	primary key (ID),
	foreign key (MerkID) references Merk(ID),
	unique(Naam)
);