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
-- Tabela Clientes | |
CREATE TABLE Clientes ( | |
Id_cliente INT PRIMARY KEY IDENTITY(1,1), | |
Nome_Cliente VARCHAR(100) NOT NULL, | |
Numero_Cartao VARCHAR(16) NOT NULL UNIQUE | |
); | |
-- Tabela Transacoes | |
CREATE TABLE Transacoes ( | |
Id INT PRIMARY KEY IDENTITY(1,1), |
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
INSERT INTO Clientes (Nome_Cliente, Numero_Cartao) | |
VALUES | |
('Jo�o Silva', '1234567890123456'), | |
('Maria Oliveira', '2345678901234567'), | |
('Carlos Souza', '3456789012345678'), | |
('Ana Costa', '4567890123456789'); |
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
INSERT INTO Transacoes (Id_Transacao,Numero_Cartao,Data_Transacao, Valor_Transacao) | |
VALUES | |
('123','1234567890123456', CONVERT(DATETIME, '2024-10-01', 120), 150.00), | |
('456','1234567890123456', CONVERT(DATETIME, '2024-10-05', 120), 750.00), | |
('789','1234567890123456', CONVERT(DATETIME, '2024-10-10', 120), 1200.00), | |
('012','2345678901234567', CONVERT(DATETIME, '2024-09-15', 120), 300.00), | |
('345','2345678901234567', CONVERT(DATETIME, '2024-09-20', 120), 600.00), | |
('678','3456789012345678', CONVERT(DATETIME, '2024-09-25', 120), 1100.00), | |
('901','4567890123456789', CONVERT(DATETIME, '2024-09-30', 120), 200.00); |
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
version: '3.8' | |
services: | |
mysql: | |
image: mysql:latest | |
container_name: meu-mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: Supersenha123! | |
MYSQL_DATABASE: teste | |
MYSQL_USER: usuario |
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
version: '3.8' | |
services: | |
mariadb: | |
image: mariadb:latest | |
container_name: meu-mariadb | |
environment: | |
MYSQL_ROOT_PASSWORD: Supersenha123! | |
MYSQL_DATABASE: teste | |
MYSQL_USER: usuario |
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
// lib/prisma.ts | |
import { PrismaClient } from '@prisma/client'; | |
let prisma: PrismaClient; | |
if (process.env.NODE_ENV === 'production') { | |
prisma = new PrismaClient(); | |
} else { | |
let globalWithPrisma = global as typeof globalThis & { | |
prisma: PrismaClient; |
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
// Array simples | |
const nomes = ['Sofia', 'Eduardo', 'Camila', 'Pedro', 'Ana', 'João', 'Mariana', 'Lucas', 'Bianca', 'Gustavo', 'Isabela', 'Rafael', 'Larissa', 'Caio', 'Gabriela', 'Felipe', 'Julia', 'Mateus', 'Letícia', 'Thiago']; | |
let ordenada = nomes.sort((a, b) => { | |
if (a < b) { | |
return -1 | |
} | |
if (a > b) { | |
return 1 |
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
class Movie { | |
constructor(props) { | |
let { | |
name, | |
year, | |
duration, | |
watched | |
} = props; | |
this.name = name; | |
this.year = year; |
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
let pessoas = [{ | |
nome: "Guilherme", | |
id: 4 | |
}, | |
{ | |
nome: "Daniel", | |
id: 2 | |
}, | |
{ | |
nome: "Rick", |
NewerOlder