J

@joaodev__

02_transform

SQL
8 months ago
/* TRANSFORMAR (limpando e padronizando) */ DROP TABLE IF EXISTS faturamento_tratado; CREATE TABLE faturamento_tratado AS SELECT id, motorista, datetime(inicio) AS inicio, datetime(fim) AS fim, CAST(

01_raw_tables

SQL
8 months ago
/* Criar tabelas BRUTAS (Raw Layer) */ DROP TABLE IF EXISTS faturamento_raw; DROP TABLE IF EXISTS pesagem_raw; CREATE TABLE faturamento_raw ( id INTEGER, motorista TEXT, inicio TEXT, fim TEXT, valor TEXT

Mini ETL Operacional

SQL
8 months ago
/* Criar tabelas BRUTAS (Raw Layer) */ DROP TABLE IF EXISTS faturamento_raw; DROP TABLE IF EXISTS pesagem_raw; CREATE TABLE faturamento_raw ( id INTEGER, motorista TEXT, inicio TEXT, fim TEXT, valor TEXT

03_kpi_queries

SQL
8 months ago
SELECT printf( '%02d:%02d:%02d', AVG((substr(tempo_faturamento,1,2) * 3600) + (substr(tempo_faturamento,4,2) * 60) + (substr(tempo_faturamento,7,2))) / 3600, (AVG((substr(tempo_faturamento,1,2) * 3

02_insert_data

SQL
8 months ago
INSERT INTO faturamento (data, ticket, transportadora, produto, peso, tempo_faturamento) VALUES ('2025-01-01', 'T001', 'Transvale', 'Etanol', 28000, '00:06:30'), ('2025-01-01', 'T002', 'Rodomax', 'Diesel', 32000, '00:05:20'), ('2025-01-02', 'T003',

01_create_tables

SQL
8 months ago
CREATE TABLE faturamento ( id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT, ticket TEXT, transportadora TEXT, produto TEXT, peso REAL, tempo_faturamento TEXT );

Mini Data Warehouse Operacional

SQL
8 months ago
CREATE TABLE faturamento ( id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT, ticket TEXT, transportadora TEXT, produto TEXT, peso REAL, tempo_faturamento TEXT );

Cálculos Básicos

NodeJS
10 months ago
// math.js function somar(a, b) { return a + b; } function multiplicar(a, b) { return a * b; } // Exportando as funções

Variáveis Iniciais

NodeJS
10 months ago
// app.js console.log("Hello World Node.js!"); // Variáveis e tipos básicos const nome = "João"; const idade = 23; const estudante = "Sim!"; console.log(`Olá ${nome}, você tem ${idade} anos`); console.log(`É estudante? ${estudante}`);

Tabela com Pessoas

SQL
1 year ago
-- Criação da tabela "Pessoas" CREATE TABLE Pessoas ( Matricula INT PRIMARY KEY, Nome VARCHAR(50) NOT NULL, Genero CHAR(1) CHECK (Genero IN ('M', 'F')), Cargo VARCHAR(50) NOT NULL, Cidade VARCHAR(50) NOT NULL ); -- Inserção de d

Tabela com Pessoas

SQL
1 year ago
-- Criação da tabela "Pessoas" CREATE TABLE Pessoas ( Matricula INT PRIMARY KEY, Nome VARCHAR(50) NOT NULL, Genero CHAR(1) CHECK (Genero IN ('M', 'F')), Cidade VARCHAR(50) NOT NULL ); -- Inserção de dados na tabela "Pessoas" INSERT

Tabela com Pessoas

SQL
1 year ago
-- Criação da tabela "Pessoas" CREATE TABLE Pessoas ( Matricula INT PRIMARY KEY, Nome VARCHAR(50) NOT NULL, Genero CHAR(1) CHECK (Genero IN ('M', 'F')), Cidade VARCHAR(50) NOT NULL ); -- Inserção de dados na tabela "Pessoas" INSERT