-
Notifications
You must be signed in to change notification settings - Fork 4
/
table.sql
31 lines (25 loc) · 832 Bytes
/
table.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
create table shapes(
id serial not null primary key,
shape text not null
);
create table colors(
id serial not null primary key,
color text not null
);
create table shapes_and_colors(
id serial not null primary key,
shape_id int not null,
foreign key (shape_id) references shapes (id),
colors_id int not null,
foreign key (colors_id) references colors (id)
);
insert into shapes(shape) values('Triangle');
insert into shapes(shape) values('Square');
insert into shapes(shape) values('Circle');
insert into shapes(shape) values('Kite');
insert into shapes(shape) values('Star');
insert into colors(color) values('Blue');
insert into colors(color) values('Yellow');
insert into colors(color) values('Red');
insert into colors(color) values('Green');
insert into colors(color) values('Pink');