Skip to content

Instantly share code, notes, and snippets.

Introduction to SQL for BigQuery and Cloud SQL
# Exploring the BigQuery Console
SELECT end_station_name FROM `bigquery-public-data.london_bicycles.cycle_hire`;
SELECT * FROM `bigquery-public-data.london_bicycles.cycle_hire` WHERE duration>=1200;
SELECT start_station_name FROM `bigquery-public-data.london_bicycles.cycle_hire` GROUP BY start_station_name;
# More SQL Keywords: GROUP BY, COUNT, AS, and ORDER BY
SELECT start_station_name, COUNT(*) FROM `bigquery-public-data.london_bicycles.cycle_hire` GROUP BY start_station_name;
SELECT start_station_name, COUNT(*) AS num_starts FROM `bigquery-public-data.london_bicycles.cycle_hire` GROUP BY start_station_name;
@mshahrin
mshahrin / cars.py
Created May 24, 2022 07:53
Google Automation with Python
#!/usr/bin/env python3
import csv
import datetime
import requests
FILE_URL = "https://storage.googleapis.com/gwg-hol-assets/gic215/employees-with-date.csv"