-
Notifications
You must be signed in to change notification settings - Fork 0
/
banco.sql
32 lines (28 loc) · 971 Bytes
/
banco.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
31
32
CREATE DATABASE project_frozen;
USE project_frozen;
CREATE TABLE usuario(
id int unsigned not null auto_increment primary key,
nome varchar(50) not null,
email varchar(50) not null,
senha varchar(50) not null
);
CREATE TABLE simulacao(
id int unsigned not null auto_increment primary key,
nome varchar(50) not null,
id_tipo int unsigned not null references tipo_simulacao(id) on update cascade on delete set null
);
CREATE TABLE tipo_simulacao(
id int unsigned not null auto_increment primary key,
nome varchar(50) not null
);
CREATE TABLE tipo_chart(
id int unsigned not null auto_increment primary key,
nome varchar(50) not null
);
CREATE TABLE charts(
id int unsigned not null auto_increment primary key,
id_tipo_chart int unsigned not null references tipo_chart(id) on update cascade on delete set null,
dados varchar(255) not null,
comentarios varchar(255) default NULL
);
INSERT INTO usuario (nome, email, senha) values('admin','admin','123');