Skip to content

Instantly share code, notes, and snippets.

View fmnobar's full-sized avatar

Farzad Mahmoodinobar fmnobar

View GitHub Profile
DROP TABLE IF EXISTS salary;
CREATE TEMPORARY TABLE salary (city VARCHAR(30), average_salary int);
INSERT INTO
salary
VALUES
('san_francisco', '54500'),
('seattle', '54100'),
('new_york', '34400'),
DROP TABLE IF EXISTS misc_part1;
CREATE TEMPORARY TABLE misc_part1 (
name VARCHAR(30),
last_contacted DATE,
contact_type VARCHAR(30)
);
INSERT INTO
misc_part1
-- Introduction
SELECT column_1, column_2… [Returns entries per specified columns]
SELECT * [Returns all entries]
SELECT DISTINCT column_1, column_2… [Returns unique entries per specified columns]
SELECT DISTINCT * [Returns all unique entries]
FROM schema_name.table_name [Specifies table to return entries from]
WHERE column_1 = ‘value’ [Specifies condition per column]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fmnobar
fmnobar / summer.csv
Created October 5, 2022 13:47
Data Manipulation with Pandas
We can't make this file beautiful and searchable because it's too large.
Year,City,Sport,Discipline,Athlete,Country,Gender,Event,Medal
1896,Athens,Aquatics,Swimming,"HAJOS, Alfred",HUN,Men,100M Freestyle,Gold
1896,Athens,Aquatics,Swimming,"HERSCHMANN, Otto",AUT,Men,100M Freestyle,Silver
1896,Athens,Aquatics,Swimming,"DRIVAS, Dimitrios",GRE,Men,100M Freestyle For Sailors,Bronze
1896,Athens,Aquatics,Swimming,"MALOKINIS, Ioannis",GRE,Men,100M Freestyle For Sailors,Gold
1896,Athens,Aquatics,Swimming,"CHASAPIS, Spiridon",GRE,Men,100M Freestyle For Sailors,Silver
1896,Athens,Aquatics,Swimming,"CHOROPHAS, Efstathios",GRE,Men,1200M Freestyle,Bronze
1896,Athens,Aquatics,Swimming,"HAJOS, Alfred",HUN,Men,1200M Freestyle,Gold
1896,Athens,Aquatics,Swimming,"ANDREOU, Joannis",GRE,Men,1200M Freestyle,Silver
1896,Athens,Aquatics,Swimming,"CHOROPHAS, Efstathios",GRE,Men,400M Freestyle,Bronze
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fmnobar
fmnobar / Data Visualization.ipynb
Created October 9, 2022 00:00
Python - Visualization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fmnobar
fmnobar / ds_salaries.csv
Created October 12, 2022 21:42
CLT, CI, Sampling
work_year experience_level employment_type job_title salary salary_currency salary_in_usd employee_residence remote_ratio company_location company_size
0 2020 MI FT Data Scientist 70000 EUR 79833 DE 0 DE L
1 2020 SE FT Machine Learning Scientist 260000 USD 260000 JP 0 JP S
2 2020 SE FT Big Data Engineer 85000 GBP 109024 GB 50 GB M
3 2020 MI FT Product Data Analyst 20000 USD 20000 HN 0 HN S
4 2020 SE FT Machine Learning Engineer 150000 USD 150000 US 50 US L
5 2020 EN FT Data Analyst 72000 USD 72000 US 100 US L
6 2020 SE FT Lead Data Scientist 190000 USD 190000 US 100 US S
7 2020 MI FT Data Scientist 11000000 HUF 35735 HU 50 HU L
8 2020 MI FT Business Data Analyst 135000 USD 135000 US 100 US L