· 7 years ago · Sep 06, 2018, 06:00 PM
1CREATE TABLE IF NOT EXISTS identification
2(
3 identification_id INTEGER PRIMARY KEY,
4 identification_first_name text NOT NULL,
5 identification_last_name text NOT NULL,
6 identification_gender text CHECK( identification_gender IN ('F','M')),
7 identification_dob text,
8 identification_title text
9);
10CREATE TABLE IF NOT EXISTS Address
11(
12 address_id INTEGER PRIMARY KEY,
13 identification_id INTEGER references Identification(identification_id) NOT NULL,
14 address_type text,
15 address_number text,
16 address_street text,
17 address_unit text,
18 address_city text,
19 address_state text,
20 address_zip_code text
21);
22CREATE TABLE IF NOT EXISTS EMAIL
23(
24 email_id INTEGER PRIMARY KEY,
25 identification_id INTEGER references Identification(identification_id) NOT NULL,
26 email TEXT NOT NULL,
27 email_preferred_indicator TEXT CHECK( email_preferred_indicator IN ('true','false'))
28);
29CREATE TABLE IF NOT EXISTS Telephone
30(
31 telephone_id INTEGER PRIMARY KEY,
32 telephone_type TEXT,
33 identification_id INTEGER references Identification(identification_id) NOT NULL,
34 telephone_number text NOT NULL
35
36);