GithubHelp home page GithubHelp logo

minhas-tarefas-mysql's Introduction

minhas-tarefas-mysql

💼 minhas-tarefas-mysql - banco de dados de exemplo em MySQL

Contém um cadastro de tarefas, separadas por usuário.

Este banco é uma versão com mais funcionalidades de tarefas-mysql.

Como carregar

Usando o MySQL Workbench, selecione File, Open Script SQL....

Selecione o arquivo scripts/tarefas.sql.

Selecione a opção Query, Execute (All or Selection).

Se preferir, você pode usar outro cliente, como o DBeaver, por exemplo.

Modelo de dados

Arquivo do MySQL Workbench: model/tarefas.mwb

Diagrama Entidade-Relacionamento

Script

CREATE SCHEMA `tarefas` DEFAULT CHARACTER SET utf8 ;

CREATE TABLE `tarefas`.`usuario` (
  `id` VARCHAR(50) NOT NULL,
  `nome` VARCHAR(200) NOT NULL,
  `senha` VARCHAR(256) NOT NULL,
  `papel` VARCHAR(50) NOT NULL DEFAULT 'usuario',
  PRIMARY KEY (`id`))
ENGINE = InnoDB;

CREATE TABLE `tarefas`.`tarefa` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `descricao` VARCHAR(200) NOT NULL,
  `concluida` TINYINT(1) NOT NULL DEFAULT 0,
  `usuario_id` VARCHAR(200) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX `fk_tarefa_usuario_idx` (`usuario_id` ASC) VISIBLE,
  CONSTRAINT `fk_tarefa_usuario`
    FOREIGN KEY (`usuario_id`)
    REFERENCES `tarefas`.`usuario` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

MySQL com Docker

docker run -p xxxx:3306 -e MYSQL_ROOT_PASSWORD=yyyy mysql:8.0.28

Substitua xxxx (por exemplo, 3306) pela porta de acesso desejada, e yyyy pela senha desejada para o usuário root (por exemplo, 1234).

Você também pode mudar a versão do MySQL, se desejar.

minhas-tarefas-mysql's People

Contributors

ermogenes avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.