Skip to content

Instantly share code, notes, and snippets.

@vipassanaecon
vipassanaecon / red_wine_excel_example_one.sql
Last active December 30, 2021 22:33
SQL for medium article 1
CREATE TABLE IF NOT EXISTS red_wine
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
fixed_acidity REAL NOT NULL,
volatile_acidity REAL NOT NULL,
citric_acid REAL NOT NULL,
residual_sugar REAL NOT NULL,
chlorides REAL NOT NULL,
free_sulfur_dioxide INTEGER NOT NULL,
total_sulfur_dioxide INTEGER NOT NULL,
@vipassanaecon
vipassanaecon / red_wine_data.csv
Last active December 30, 2021 22:34
red wine csv data for medium article
fixed acidity volatile acidity citric acid residual sugar chlorides free sulfur dioxide total sulfur dioxide density pH sulphates alcohol quality type
7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5 RED
7.8 0.88 0 2.6 0.098 25 67 0.9968 3.2 0.68 9.8 5 RED
7.8 0.76 0.04 2.3 0.092 15 54 0.997 3.26 0.65 9.8 5 RED
11.2 0.28 0.56 1.9 0.075 17 60 0.998 3.16 0.58 9.8 6 RED
7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5 RED
7.4 0.66 0 1.8 0.075 13 40 0.9978 3.51 0.56 9.4 5 RED
7.9 0.6 0.06 1.6 0.069 15 59 0.9964 3.3 0.46 9.4 5 RED
7.3 0.65 0 1.2 0.065 15 21 0.9946 3.39 0.47 10 7 RED
7.8 0.58 0.02 2 0.073 9 18 0.9968 3.36 0.57 9.5 7 RED
@vipassanaecon
vipassanaecon / red_wine_excel_example_two.sql
Last active December 30, 2021 22:39
SQL for medium article 2
CREATE TABLE IF NOT EXISTS red_wine
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
fixed_acidity REAL NOT NULL,
volatile_acidity REAL NOT NULL,
citric_acid REAL NOT NULL,
residual_sugar REAL NOT NULL,
chlorides REAL NOT NULL,
free_sulfur_dioxide INTEGER NOT NULL,
total_sulfur_dioxide INTEGER NOT NULL,
@vipassanaecon
vipassanaecon / Update example script 1.sql
Last active January 4, 2022 23:14
Update example script 1
-- Update example script 1
= "update region_table
set isopen = 'Y' "&"
, isavailable = 'N'
, isrestricted = 'Y'
, user_last_modified = 'user_migration'
, date_last_modified = sysdate
where state_plan_id = (
select table_id "&"
from state_table st
@vipassanaecon
vipassanaecon / Update example script 2.sql
Last active January 4, 2022 23:16
Update example script 2
-- Update example script 2
"update region_table
set isopen = 'Y'
, isavailable = 'N'
, isrestricted = 'Y'
, user_last_modified = 'user_migration'
, date_last_modified = sysdate
where state_plan_id = (
select table_id
from state_table st
@vipassanaecon
vipassanaecon / Update example script 3.sql
Last active January 4, 2022 23:16
Update example script 3
-- Update example script 3 (final)
update region_table
set isopen = 'Y'
, isavailable = 'N'
, isrestricted = 'Y'
, user_last_modified = 'user_migration'
, date_last_modified = sysdate
where state_plan_id = (
select table_id
from state_table st
@vipassanaecon
vipassanaecon / food.csv
Last active January 21, 2022 20:10
food.csv
food_exp income
115.22 3.69
135.98 4.39
119.34 4.75
114.96 6.03
187.05 12.47
243.92 12.98
267.43 14.2
238.71 14.76
295.94 15.32
@vipassanaecon
vipassanaecon / advertising.csv
Last active January 21, 2022 20:11
advertising.csv
tv sales
230.1 22.1
44.5 10.4
17.2 9.3
151.5 18.5
180.8 12.9
8.7 7.2
57.5 11.8
120.2 13.2
8.6 4.8
@vipassanaecon
vipassanaecon / ISL - simple regression analysis.ipynb
Created January 21, 2022 22:30
ISL - simple regression analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vipassanaecon
vipassanaecon / simple_linear_regression_food.ipynb
Last active January 23, 2022 02:38
simple_linear_regression_food
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.