Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Evandro Costa] - Desafio concluído para a vaga de Desenvolvedor Backend Júnior (remoto) #98

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Next Next commit
create init.sql file
evans-costa committed Nov 15, 2024
commit f54805e95159d227ba95da0ad5dc19ef99773fb9
17 changes: 15 additions & 2 deletions init.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
USE test_db;

--TODO Crie a tabela de user;
CREATE TABLE IF NOT EXISTS `user` (
id int AUTO_INCREMENT NOT NULL,
firstName varchar(100) NOT NULL,
lastName varchar(100) NOT NULL,
email varchar(100) NOT NULL,
PRIMARY KEY (id)
);

--TODO Crie a tabela de posts;
CREATE TABLE IF NOT EXISTS post (
id int AUTO_INCREMENT NOT NULL,
title varchar(100) NOT NULL,
description varchar(100) NOT NULL,
userId int NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (userId) REFERENCES `user`(id)
);