Skip to content

Instantly share code, notes, and snippets.

@agawronski
agawronski / basic_sql_explore_9.sql
Last active January 14, 2018 23:59
Investigating purchasing.productvendor and purchasing.vendor, join examples, create table example Postgres
-- Investigating purchasing.productvendor and purchasing.vendor
\d purchasing.productvendor
\d purchasing.vendor
-- How many records are there in each table?
-- How many different businessentityid?
select
count(*) as num_records,
count(distinct businessentityid) as num_businessentityid
@agawronski
agawronski / basic_sql_explore_10.sql
Created January 14, 2018 21:18
Filter SQL queries, examples. Is, is not, equal, not equal, in, not in, greater than, less than, and, or.
-- Are there any null values in the EndDate field
-- of the humanresources.employeedepartmenthistory table?
-- If so how many records are there?
select count(*)
from humanresources.employeedepartmenthistory
where EndDate is null;
-- How many records are there where EndDate is not null?
select count(*)
from humanresources.employeedepartmenthistory
@agawronski
agawronski / whoop-goldencheetah.py
Created September 22, 2020 04:02 — forked from jkreileder/whoop-goldencheetah.py
Python 3 script to export WHOOP Strap recovery data for use with Golden Cheetah
#!/usr/bin/env python3
import requests # for getting URL
import json # for parsing json
from datetime import datetime # datetime parsing
import pytz # timezone adjusting
import csv # for making csv files
import os
#################################################################