· 5 years ago · Apr 25, 2020, 07:02 AM
1drop table if exists tbColors;
2drop table if exists tbPeople;
3drop table if exists tbAdmin;
4drop table if exists tbMeetings;
5
6create table tbColors (
7 id int primary key,
8 colorName varchar(10)
9);
10
11create table tbPeople (
12 freshId int primary key,
13 oldId int not null,
14 fullName varchar(50) not null,
15 birthDate date not null,
16 color int not null,
17 cpf varchar(14)
18);
19
20create table tbAdmin (
21 id int primary key,
22 fullName varchar(50) not null,
23 code varchar(5) not null,
24 birthDate date,
25 cpf varchar(14)
26);
27
28create table tbMeetings (
29 id int primary key,
30 keyGenerator varchar(5) not null,
31 meetingDate date not null,
32 presents int ARRAY not null
33);
34
35insert into tbColors values
36 (1, 'red'),(2, 'yellow');
37insert into tbAdmin values
38 (1, 'José Bezerra', 'AAA11', '1995-05-05', '123.456.784-11'),
39 (2, 'Mickey Mouse', 'BBB22', '1954-01-01', '321.654.987-45');
40insert into tbPeople values
41 (1, 1, 'Rapunzel', '1996-12-12', 1, '123.456.789-12'),
42 (2, 2, 'Luciano Huck', '1945-11-12', 2, '123.456.789-13');
43insert into tbMeetings values
44 (1, 'AAA11', '2020-01-01', '{1, 2}');