-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlmay.sql
50 lines (42 loc) · 1.33 KB
/
sqlmay.sql
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
43
44
45
46
47
48
49
50
drop table if exists manufacturers;
drop table if exists transportsc;
drop table if exists transports;
drop table if exists tclasse;
create table tclasse (
id_tclasse serial
constraint id_classe_pk
primary key ,
tclasse_name varchar
);
create table transports (
id_transport serial
constraint id_transport_pk
primary key ,
transport_name varchar,
transport_type varchar,
model varchar,
cost_in_credits int,
length int,
max_atmosphering_speed int,
crew int,
passengers int,
cargo_capacity int,
consumables int,
id_tclasse int
constraint id_tclasse_fk
references tclasse
on delete cascade
);
create table transportsc (
id_transport serial
constraint id_transportc_pk
primary key ,
hyperdrive_rating decimal(2,1),
mglt int
);
create table manufacturers (
id_manufacturer serial
constraint id_manufacturer_pk
primary key ,
manufacturer_name varchar
);