This file contains 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
const test = require('node:test') | |
const assert = require('assert') | |
// object | |
// description | |
// write a function that receives an object, destructure a property "name" and returns it | |
// destructure({ name: 'Zambs' }) // returns Zambs | |
// solution | |
function destructureObj({name}) { |
This file contains 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
-- Encontre o ator Johnny Cage | |
SELECT * FROM sakila.actor | |
WHERE first_name = 'JOHNNY' AND last_name = 'CAGE'; | |
-- Encontre os filmes que podem ser alugados exatamente por 6 dias | |
SELECT title, rental_duration FROM sakila.film | |
WHERE rental_duration = 6 | |
-- Encontre os filmes de classificação R que podem ser alugados exatamente por 6 dias | |
SELECT title, rental_duration, rating from SAKILA.FILM |
This file contains 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
'use strict'; | |
/** @type {import('sequelize-cli').Migration} */ | |
module.exports = { | |
async up(queryInterface, Sequelize) { | |
await queryInterface.createTable('courses', { | |
id: { | |
allowNull: false, | |
autoIncrement: true, | |
primaryKey: true, | |
type: Sequelize.INTEGER |
This file contains 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
varchar(32) Lorem ipsum dolor sit amet amet. | |
varchar(64) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donecie | |
varchar(128) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donecie | |
vestibulum massa. Nullam dignissim elementum molestie. Vehiculas | |
varchar(256) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donecie | |
vestibulum massa. Nullam dignissim elementum molestie. Vehiculas | |
velit metus, sit amet tristique purus condimentum eleifend. Quis |
This file contains 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
CREATE DATABASE library; | |
USE library; | |
CREATE TABLE categories ( | |
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, | |
name VARCHAR(100) NOT NULL | |
); | |
CREATE TABLE clients ( | |
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, |
This file contains 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
-- SELECT * FROM sakila.address; | |
-- Ver os endereços com nomes das cidades | |
-- SELECT a.address_id, a.address, c.city FROM sakila.address AS a | |
-- INNER JOIN sakila.city AS c | |
-- ON a.city_id = c.city_id | |
-- WHERE a.address_id = 8 | |
-- Ver qual cidade tem mais endereços | |
-- SELECT COUNT(*), sakila.address.city_id, sakila.city.city FROM sakila.address |
This file contains 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
-- DB PIXAR | |
DROP SCHEMA IF EXISTS Pixar; | |
CREATE SCHEMA Pixar; | |
USE Pixar; | |
CREATE TABLE Movies ( | |
id INTEGER auto_increment PRIMARY KEY NOT NULL, | |
title VARCHAR(30) NOT NULL, | |
director VARCHAR(30) NULL, |
This file contains 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
-- Cadastrar uma nova loja | |
-- Necessário criar um endereço | |
-- Endereço: Rua dos Alfeneiros, Little Whinging | |
-- INSERT INTO sakila.address (district, address, city_id, phone, location) | |
-- VALUES ( | |
-- 'Little Whinging', | |
-- 'Rua dos Alfeneiros', | |
-- 26, | |
-- '12345678901234567890', | |
-- POINT(-48.9494566, -16.3333469) |
This file contains 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
-- Encontre o ator Johnny Cage | |
SELECT * FROM sakila.actor | |
WHERE first_name = 'JOHNNY' AND last_name = 'CAGE'; | |
-- Encontre os filmes que podem ser alugados exatamente por 6 dias | |
SELECT * FROM sakila.film WHERE rental_duration = 6 | |
-- Encontre os filmes de classificação R que podem ser alugados exatamente por 6 dias | |
SELECT * FROM sakila.film WHERE rental_duration = 6 AND rating = 'R' |
This file contains 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
import {describe, expect, it} from 'vitest'; | |
describe('Character', () => { | |
it('should have strength, dexterity and intelligence', () => { | |
const isaac = new Character(5, 6, 7); | |
expect(isaac.strength).toBe(5); | |
expect(isaac.dexterity).toBe(6); | |
expect(isaac.intelligence).toBe(7); | |
}) |
NewerOlder