Oreilly Intermediate SQL For Data Analysis
Oreilly Intermediate SQL For Data Analysis
If you cannot install or download any software, you can use SQLiteOnline.com which is an
online-only SQLite editor.
Getting Resource Files
The few resources needed for this class are available on GitHub:
https://github.com/thomasnield/oreilly_intermediate_sql_for_data
Unzip the contents to a location of your choice, and note where you put them
Contents include:
◦ A SQLite database file called thunderbird_manufacturing.db
◦ Class notes with all examples (in three formats)
◦ Slides
Section II Exercise
Bring in all fields from CUSTOMER_ORDER, but for each record show the total quantity ordered
for that given CUSTOMER_ID and PRODUCT_ID.
Section III Exercise
Find all customers with an address containing a 3-4 digit street number
INNER JOIN
LEFT OUTER JOIN
Section VI Exercise
For every CALENDAR_DATE and CUSTOMER_ID, show the total QUANTITY ordered for the date
range of 2017-01-01 to 2017-03-31:
Section V Exercise
For the month of March, bring in the rolling sum of QUANTITY ordered (to each ORDER_DATE) by
CUSTOMER_ID and PRODUCT_ID.
Windowing Functions Support
Windowing functions are found on many database platforms, including:
◦ Oracle
◦ Teradata
◦ PostgreSQL
◦ SQL Server
◦ Apache Spark SQL
◦ MySQL (as of version 8)
◦ SQLite (as of version 3.25.0)