Intermediate SQL: For Data Analysis
Intermediate SQL: For Data Analysis
Author of Getting Started with SQL by O'Reilly and Learning RxJava by Packt
You can install DB Browser, or use a portable version where you can download, unzip, and launch
the executable.
If you cannot install or download any software, you can use SQLiteOnline.com which is an
online-only SQLite browser.
Getting Resource Files
The few resources needed for this class are available on GitHub:
https://github.com/thomasnield/oreilly_advanced_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)
◦ A customer_order.sql SQL script file to create a CUSTOMER_ORDER table
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 ending in "Blvd" or "St"
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)
TalkTalk gets record £400K fine for failing to prevent October 2015 attack
https://ico.org.uk/about-the-ico/news-and-events/news-and-blogs/2016/10/talktalk-gets-record-400-
000-fine-for-failing-to-prevent-october-2015-attack/