Skip to content

Instantly share code, notes, and snippets.

View Lukas-Michalek's full-sized avatar
💭
He who fears he shall suffer, already suffers what he fears.

Lukas Michalek Lukas-Michalek

💭
He who fears he shall suffer, already suffers what he fears.
View GitHub Profile
@Lukas-Michalek
Lukas-Michalek / trapping_rainwater_clean_solution.js
Last active April 14, 2023 18:06
Trapping Rainwater Practise Algorithm for Technical Interview
const trappedRainwater = (arr) => {
let totalWater = 0;
let leftMax = arr[0];
let rightMax = arr[arr.length - 1];
let leftIndex = 1; // Note that I do not take in consideration the very first element and the very last element of array as they will never catch any water
let rightIndex = arr.length - 2;
@Lukas-Michalek
Lukas-Michalek / freds_furniture.sql
Last active December 22, 2024 06:33
DATABASE NORMALIZATION practise project -> This project is part of the Advanced postgreSQL of Full Stack Sfotware Developer carrer path in CODECADEMY
-- Table creation
CREATE TABLE store(
order_id integer,
order_date date,
customer_id integer,
customer_phone varchar(50),
customer_email text,
item_1_id integer,
item_1_name varchar(100),
@Lukas-Michalek
Lukas-Michalek / a_book_store_indexes.sql
Last active February 16, 2023 00:07
Advanced PostgreSQL project focused on practising INDEXES in Databases. Project is part of Advanced PostgreSQL Module in Codecademy Full Stack Developer Path.
-- Table Creation Process
CREATE TABLE books (
book_id integer,
title varchar(250),
author varchar(250),
original_language varchar(100),
first_published integer,
sales_in_millions numeric,
price numeric
@Lukas-Michalek
Lukas-Michalek / inventory_database.sql
Last active December 22, 2024 06:35
Advanced PostgreSQL project focused on practising advanced postgreSQL and constraints type. Project is part of Advanced PostgreSQL Module in Codecademy Full Stack Developer Path.
-- The parts table is the central table in our database, it stores all the information about the individual parts in our storeroom. Let’s make sure that we have some basic checks in place to ensure data integrity. Alter the code column so that each value inserted into this field is unique and not empty.
ALTER TABLE parts
ADD UNIQUE(code);
ALTER TABLE parts
ALTER COLUMN code SET NOT NULL;
-- The parts table is missing values in the description column. Alter the table so that all rows have a value for description.
@Lukas-Michalek
Lukas-Michalek / chinese_restaurant.sql
Last active February 11, 2023 20:14
Project based on practising Database Schema, Database KEYS and Database REALITIONSHIPS
/*
Creating Tables and Relationships =>
ONE TO ONE => restaurant and address
ONE TO MANY => restaurant and review
MANY TO MANY => category and dish => categories_dishes
*/
CREATE TABLE restaurant(
@Lukas-Michalek
Lukas-Michalek / alyft_trip_data.sql
Last active February 9, 2023 18:09
Project focused on practising DATABASE JOINS. This project was a part of Full Stack Software Developer Course in Codecademy
--Let’s practice what we learned about joins by combining rows from different tables..
--Suppose you are a Data Analyst at Lyft, a ride-sharing platform. For a project, you were given three tables:
--trips: trips information
--riders: user data
--cars: autonomous cars
-- trips table
@Lukas-Michalek
Lukas-Michalek / analyze-hacker-news-trends.sql
Last active December 22, 2024 06:38
Yet another Project focused on practising DATABASE AGGREGATE FUNCTIONS. This project was a part of Full Stack Software Developer Course in Codecademy
@Lukas-Michalek
Lukas-Michalek / trends-in-startups.sql
Created February 8, 2023 23:37
Project focused on practising DATABASE AGGREGATE FUNCTIONS. This project was a part of Full Stack Software Developer Course in Codecademy
@Lukas-Michalek
Lukas-Michalek / new_york_restaurants.sql
Created February 8, 2023 15:43
Miniproject focused on DATABASE QUERIES. Part of the Dataase Quories module of Full Stack Sfotware Developer by Codecademy.
-- First, let`s create a Table
CREATE TABLE nomnom (
name TEXT,
neighborhood TEXT,
cuisine TEXT,
review REAL,
price TEXT,
health TEXT
CREATE TABLE films (
name TEXT,
release_year INTEGER
);
INSERT INTO films (name, release_year)
VALUES ('The Matrix', 1999);
INSERT INTO films (name, release_year)
VALUES ('Monsters, Inc.', 2001);