R script to plot graphs, and some useful SQL queries.