Letícia Santos Rocha
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Super Bônus | SQL Autor: Letícia Rocha💕 * [toc] ## Modelagem 1: Catálogo Google Play https://www.db-fiddle.com/f/bZMAArWFJv25wGdivWUmVN/5 > Create script ```sql= create table Tb_Google_Play ( id int primary key auto_increment, Nome varchar(100), Genero varchar(100), Dsp_AppStore varchar(100), Dsp_GgPlay varchar(100), Atualizacao date, Tamanho varchar(100), Criador varchar(100), Avaliacao decimal(10,3), Download int ); ``` > Insert script ```sql= Insert into Tb_Google_Play (Nome, Genero, Dsp_AppStore, Dsp_GgPlay, Atualizacao, Tamanho, Criador, Avaliacao, Download) Values ('Mobile Legends Bang Bang', 'Ação', 'Disponível', 'Disponível', '2021-04-08', '104 MB', 'Moonton', 26000, 10000000), ('Ler e Contar', 'Educativo', 'Disponível', 'Indisponível', '2020-12-04', '39,31 MB', 'Bergman', 13000, 1000000), ('Puzzle Combat', 'RPG', 'Disponível', 'Disponível', '2021-04-14', '103 Mb', 'Small Giant', 43000, 1000000), ('Infinite Tiles', 'Música', 'Diponível', 'Indisponínel', '2021-03-11', '27,38 MB', 'Opala Studios', 24000, 5000000), ('Damas', 'Tabuleiro', 'Disponível', 'Indisponível', '2021-03-13', '3,33 MB', 'Checkers', 43000, 1000000000), ('The Sims', 'Simulação', 'Disponível', 'Disponível', '2021-01-28', '113 MB', 'Electronic Arts', 420000, 50000000), ('True skate', 'Esportes', 'Disponível', 'Disponível', '2021-03-08', '100 MB', 'True Axis', 440000, 5000000), ('Trivia 360', 'Curiosidades', 'Disponível', 'Indisponível', '2021-04-01', '30,61 MB', 'Smart Owl', 108000, 5000000), ('Clash of Clans', 'Estratégia', 'Disponível', 'Disponivél', '2021-04-15', '166 MB', 'Supercell', 55000, 500000000), ('Table Top Racing', 'Corrida', 'Indisponível', 'Indisponível', '2019-01-11', '127 MB', 'Playrise Digital', 100000, 100000); ``` > Select script ```sql= select * from Tb_Google_Play; SELECT* FROM Tb_Google_Play WHERE Dsp_AppStore= 'Diponível'; SELECT* FROM Tb_Google_Play WHERE Download = '1000000' ORDER BY Download > 1000000; SELECT* FROM Tb_Google_Play WHERE Avaliacao = '13000' ORDER BY Avaliacao DESC; ``` ## Modelagem 2: Países https://www.db-fiddle.com/f/tvsHra4VtmcAL99341FCsv/1 > Create script ```sql= Create table Tb_Paises ( id int primary key auto_increment, Nome varchar(100), Sigla varchar(100), Populacao int, Area int, Dt_aniversario varchar(100), Pib int, Continente varchar(100), Capital varchar(100), Idioma varchar(100) ); ``` > Insert script ```sql= Insert into Tb_Paises (Nome, Sigla, Populacao, Area, Dt_aniversario, Pib, Continente, Capital, Idioma) Values ('Brasil', 'BRA', 2126000, 851600000, '1082-07-07', 136300000, 'América do Sul', 'Brasília', 'Português'), ('Rússia', 'URSS', 1444000, 171000000, '1921-09-05', 158400000, 'Leste Europeu e Norte da Ásia', 'Moscou', 'Russo'), ('Estados Unidos', 'EUA', 3282000, 983400000, '1776-04-07', 208100000, 'América do Norte', 'Washington, D.C', 'Inglês'), ('Bélgica', 'BEL', 11480000, 305280000, '1993-05-30', 543000000, 'Europa', 'Cidade de Bruxelas', 'Neerlandês, Francês e Alemão'), ('Bolívia', 'BOB', 1000000, 1098581, '1825-08-06', 395000000, 'Centro oeste da América do Sul', 'Sucre', 'Espanhol, Quechua, Aimara e Guaraní'), ('Canadá', 'CAN', 37168992, 9976139, '1867-07-01', 162700000, 'Americano', 'Ottawa', 'Inglês e o Francês'), ('França', 'FR', 62600000, 5491900, '1789-07-14', 255100000, 'Europeu', 'Paris', 'Francês'), ('Hungria', 'HG', 9770000, 9303000, '1991-05-26', 1499000, 'Leste Europeu', 'Budapeste', 'Húngara'), ('Jamaica', 'JMC', 2948000, 1099000, '1962-11-05', 1646000, 'América Central', 'Kingston', 'Inglês jamaicano'), ('Portugal', 'PT', 1020000, 9223000, '1580-06-10', 22170000, 'Continente Europeu', 'Lisboa', 'Língua portuguesa'); ``` > Select script ```sql= select * from Tb_Paises; SELECT* FROM Tb_Paises WHERE Dt_aniversario = '1776-04-07' ORDER BY Dt_aniversario > 1776-04-07; SELECT* FROM Tb_Paises WHERE id=10; SELECT* FROM Tb_Paises WHERE Nome = 'Canadá'; SELECT* FROM Tb_Paises WHERE Pib = '543000000' ORDER BY Pib ASC; ``` ## Modelagem 3: Clube Futebol https://www.db-fiddle.com/f/s7TGVZM5geELaox9o6pkQ9/3 > Create script ```sql= create table Tb_Clube_futebol ( id int primary key auto_increment, Nm_Time varchar(100), Ds_Sigla varchar(100), Nm_Pais varchar(100), Nm_Cidade varchar(100), Dt_fundacao date, Qnt_titulos int, Nm_Presidente varchar(100), Cpc_Estadio int, Nm_Estadio varchar(100) ); ``` > Insert script ```sql= insert into Tb_Clube_futebol (Nm_Time, Ds_Sigla, Nm_Pais, Nm_Cidade, Dt_fundacao, Qnt_titulos, Nm_Presidente, Cpc_Estadio, Nm_Estadio) Values ('flamengo', 'CRF', 'Brasíl', 'Rio de Janeiro', '1899-10-17', 7, 'Luiz Rodolfo Landim Machado',78838, 'Estádio do Maracanã'), ('Palmeiras', 'SEP', 'Brasíl', 'São Paulo', '1914-07-26', 39, 'Mauricio Galiotte', 120000,'Cícero Pompeu de Toledo'), ('Corinthians', 'SCCP','Brasíl', 'Brasília', '1910-07-01', 30, 'Duílio Monteiro Alves',45200 ,'Mané Garrincha'), ('Barcelona','FCB','Brasíl','Fortaleza','1899-10-29', 30, 'Joan Laporta', 20268, 'Estádio Presidente Vargas'), ('Internacional', 'SCI', 'Brasíl', 'São Paulo', '1909-04-04', 18, 'Alessandro Barcellos', 72000, 'Cícero Pompeu de Toledo'), ('Botafogo', 'BFC', 'Brasíl','Rio de Janeiro', '1894-06-01', 27, 'Durcesio Melo', 35000, 'Nilton Santos'), ('Santos', 'FC','Brasíl','São Paulo', '1912-04-14', 3, 'Andrés Rueda', 16068, 'Urbano Caldeira'), ('São Paulo', 'SPFC', 'Brasíl', 'São Paulo', '1930-01-25', 12, 'Julio Casares', 72039, 'Morumbi'), ('Chapecoense', 'ACF', 'Brasil', 'Rio de janeiro','1973-05-10', 7, 'Paulo Magro', 19999, 'Estádio das Laranjeiras'), ('Real madrid', 'RMCF', 'Brasil', 'Rio de janeiro', '1902-03-06', 11, 'Florentino Pérez', 18000, 'Ítalo del Cima'); ``` > Select script ```sql= select * from Tb_Clube_futebol; SELECT* FROM Tb_Clube_futebol WHERE Nm_time = 'flamengo' ORDER BY Nm_time DESC; SELECT* FROM Tb_Clube_futebol WHERE Qnt_titulos = 7 ORDER BY Qnt_titulos ASC; ``` ## Modelagem 4: Música https://www.db-fiddle.com/f/6nvHcs1AUUAHSYaKMnUDE3/2 > Create script ```sql= Create table tb_musica ( id int primary key auto_increment, nome varchar(100), artista varchar(100), album varchar(100), genero varchar(100), dt_lancamento date, tt_views varchar(100), tt_likes decimal(10,2), duracao time ); ``` > Insert script ```sql= insert into tb_musica (nome, artista, album, genero, dt_lancamento, tt_views, tt_likes, duracao) values ('Perfect', 'Ed Sheeran e Andrea Bocelli', 'Perfect Symphony - Single', 'Clássico', '2017-12-15', '332.572.367', 260000, '04:25'), ('Meu Abrigo', 'Gabriela Melim, Rodrigo Melim, Diogo Melim', 'Melim', 'pop', '2017-12-08', '376.259.414', 330000, '03:53'), ('Bad guy' , 'Billie Eilish', 'desconhecido','pop', '2019-03-29', '1.082.191.156', 1600000, '3:14'), ('Believer', 'Imagine Dragons', 'Evolve', 'Electro', '2017-03-07', '1.872.890.123', 1600000, '3:24'), ('Havana', 'Camila Cabello', 'Camila', 'Pop', '2017-08-03', '1.782.440.712', 950000, '3:36'), ('La Vida Continuó', 'Karol G, Simone e Simaria', 'Ocean', 'Pop', '2020-04-28', '63.847.025', 616000, '2:45'), ('Andei Só', 'Natiruts', 'Verbalize', 'Reggae', '2001-02-09', '149.727.004', 5400000, ' 4:32'), ('Pisando Descalço', 'Maneva', 'Ao Vivo', 'Reggae', '2017-03-15', '110.567.000', 1500000, '3:47'), ('1 Minuto', 'Negra Li e D. Black', 'Sem Ar', 'Romanticismo', '2008-06-26', '49.448.071', 38900000, '3:30'), ('O Sol', 'Vitor Kley', 'Até onde vai', 'Pop', '2017-10-13', '244.290.508', 2400000, '4:18'); ``` > Select script ```sql= SELECT * FROM tb_musica; SELECT* FROM tb_musica WHERE nome; SELECT* FROM tb_musica WHERE id= 2 ORDER BY dt_lancamento > 2017-03-07; SELECT* FROM tb_musica WHERE id= 5; SELECT* FROM tb_musica WHERE duracao = '03:14' ORDER BY duracao ASC; ``` ## Modelagem 5: Concessionária > Create script ```sql= create table Tb_Concessionária ( id int primary key auto_increment, Modelo Varchar(100), Marca Varchar(100), Ano_fabricacao int, Ano_modelo int, Drc_Hidráulica Varchar(100), Ar_Condicionado Varchar(100), Kilometragem varchar(100), Preco decimal(10,5), Cor varchar(100) ); ``` > Insert script ```sql= Insert into Tb_Concessionária ( Modelo, Marca, Ano_fabricacao, Ano_modelo, Drc_Hidráulica, Ar_Condicionado, Kilometragem, Preco, Cor) Values('Fiat', 'Mobi', 2021, 2016, 'Não', 'Sim', '0Km', 51.99000, 'Branco'), ('Agile', 'Chevrolet', 2021, 2013, 'Sim', 'Sim', '078.644Km', 39.59000, 'Prata'), ('Virtus', 'Volkswagen', '2021', '2018', 'Não', 'Sim','700Km', 69.90000, 'Cinza'), ('2.0 sDrive18i', 'BMW X1', '2021', '2014', 'Sim', 'Sim', '74.000 Km', 71.900, 'Preto'), ('HB20', 'Hyundai', 2019, 2012, 'Sim', 'Sim', '14.200 Km', 47.900, 'Vermelho'), ('T-Cross', 'Volkswagen', 2021, 2020, 'Não', 'Não', 'OKm', 111.590, 'Azul'), ('Polo 1.0', 'Volkswagen', 2021, 2020, 'Sim', 'Sim', '43.000 Km', 56.890, 'Prata'), ('Hatch SE 1.0', 'Ford Ka', 2021, 2015, 'Não', 'Sim', '75.400Km', 31.790, 'Preto'), ('EcoSport', 'Ford', 2021, 2017, 'Não', 'Não', '78.614Km', 57.958, 'Preto'), ('Uno', 'Fiat', 2020, 2016, 'Sim', 'Sim', '0Km', 50.990, 'Preto'); ``` > Select script ```sql= Select * from Tb_Concessionária; SELECT* FROM Tb_Concessionária WHERE Modelo = 'HB20' ORDER BY Modelo DESC; SELECT* FROM Tb_Concessionária WHERE Ano_modelo = 2016 ORDER BY Ano_modelo ASC; SELECT* FROM Tb_Concessionária WHERE Marca = 'Chevrolet' ORDER BY Marca; SELECT* FROM Tb_Concessionária WHERE id= 10; ``` ## Modelagem 6: Tb_Computador https://www.db-fiddle.com/f/8w4mEyc4SfPWooAc3ActCP/3 > Create script ```sql= create table Tb_Computador( id int primary key auto_increment, Marca varchar(100), Processador varchar(100), Mmr_Ram varchar(100), Armazenamento varchar(100), Opr_sistema varchar(100), Vmc_Office varchar(100), Tamanho int, Preco decimal(10,2) ); ``` > Insert script ```sql= Insert into Tb_Computador (Marca, Processador, Mmr_Ram, Armazenamento, Opr_sistema, Vmc_Office, Tamanho, Preco) Values ('VISION', 'Intel Core i5-3330 3.00GHz', '8GB DDR3', 'SSD 120GB', 'Windows 10', 'Não', 15, 2799), ('Genérico', 'Intel I3', 'DDR3 SDRAM', ' SSD 120 GB', 'Linux', 'Sim', 19, 2099), ('AMORIM SHOP', 'Intel Core i3-3220 3.30GHz', '16 GB DDR3', 'SSD 400 GB', 'Windows 10 Pro', 'Sim', 19, 2299), ('Chip7 Informática', 'Intel Core i5 1155', '8GB RAM DDR3', 'HD SSD 480GB', 'Windows 10', 'Sim', 19, 2945), ('Intel', 'Intel Core I3-550', '4 GB DDR', 'SSD 120gb', 'Windows 10 TRIAL', 'Não', 20, 1890), ('Intel', 'Intel Core I3-530', '4 GB DDR', 'HD 500GB', 'Windows 10', 'Sim', 19, 2240), ('FIRST ONE', 'Intel Core i5', 'DDR 8 GB', 'HD 500 GB', 'Windows 10 Pro', 'Não', 25, 2199), ('HYDRAGAMER', 'AMD ATHLON 3000G', 'DDR 8 GB', 'SSD 2,5 Hydra 240gb', 'Windows 10 Trial', 'Sim', 19, 3399), ('F-New', 'Intel', '8 GB DDR3','SSD 240gb', 'Windows 10', 'Não', 18, 2995), ('Fácil Computadores', 'Intel Core I5 3470S', '8GB 1066 MHz', 'SSD 240 GB', 'Windows 10 Trial', 'Sim', 18.5, 2659); ``` > Select script ```sql= select * from Tb_Computador; SELECT* FROM Tb_Computador WHERE id= 5; SELECT* FROM Tb_Computador WHERE Vmc_Office = 'Sim'; SELECT* FROM Tb_Computador WHERE Tamanho = '18' ORDER BY Tamanho > 18; SELECT* FROM Tb_Computador WHERE Preco = '2099' ORDER BY Preco DESC; ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully