-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCRIPT.txt
37 lines (30 loc) · 834 Bytes
/
SCRIPT.txt
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
create database DB_AGENDA
use DB_AGENDA;
CREATE TABLE tarefas
( id INT(11) NOT NULL AUTO_INCREMENT,
nome VARCHAR(30) NOT NULL,
datatarefa DATE,
descricao VARCHAR(255),
id_cadStatus int(11),
id_tipoMateria int(11),
id_tipoTarefa int(11),
CONSTRAINT tarefas_pk PRIMARY KEY (id),
FOREIGN KEY (id_cadStatus) REFERENCES cadStatus(id),
FOREIGN KEY (id_tipoMateria) REFERENCES tipoMateria(id),
FOREIGN KEY (id_tipoTarefa) REFERENCES tipoTarefa(id)
);
create table cadStatus(
id INT(11) NOT NULL AUTO_INCREMENT,
nome VARCHAR(20),
CONSTRAINT cadStatus PRIMARY KEY (id)
);
create table tipoMateria(
id INT(11) NOT NULL AUTO_INCREMENT,
nome VARCHAR(20),
CONSTRAINT tipoMateria PRIMARY KEY (id)
);
create table tipoTarefa(
id INT(11) NOT NULL AUTO_INCREMENT,
nome VARCHAR(20),
CONSTRAINT tipoTarefa PRIMARY KEY (id)
)