-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheme.sql
29 lines (25 loc) · 885 Bytes
/
scheme.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
CREATE TABLE person (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
CREATE TABLE phones (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
person_id INTEGER NOT NULL REFERENCES person(id),
phone TEXT
);
CREATE TABLE birthdays (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
person_id INTEGER NOT NULL REFERENCES person(id),
birthday TEXT
);
CREATE TABLE addresses (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
person_id INTEGER NOT NULL REFERENCES person(id),
address TEXT NOT NULL
);
CREATE TABLE persons_associated (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
person_id INTEGER NOT NULL REFERENCES person(id),
name TEXT NOT NULL,
birth TEXT
);