Created
July 3, 2018 03:34
-
-
Save luiseduardogfranca/f5b0fe16ab52663325a60f3cedfd74e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop database if exists codificando; | |
create database if not exists codificando; | |
use codificando; | |
create table if not exists adm( | |
id integer auto_increment not null primary key, | |
first_name varchar(50) not null, | |
last_name varchar(50) not null, | |
email varchar(50) not null unique, | |
born date not null, | |
`password` varchar(15) not null, | |
description varchar(400) not null, | |
`gender` varchar(25) not null | |
); | |
create table if not exists article( | |
id integer auto_increment not null primary key, | |
title varchar(200) not null, | |
description text not null, | |
date_create date not null, | |
id_adm integer not null, | |
constraint article_adm | |
foreign key (id_adm) | |
references adm(id) | |
on delete cascade | |
on update cascade | |
); | |
create table if not exists section( | |
id integer auto_increment not null primary key, | |
title varchar(50) not null, | |
content mediumtext not null, | |
id_article integer not null, | |
constraint secao_article | |
foreign key (id_article) | |
references article(id) | |
on delete cascade | |
on update cascade | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment