Summary
Repository for Towards Data Science article: "When spreadsheets aren’t good enough: A lesson in relational databases". Includes follow-along SQL code to demonstrate how to structure relational databases using MySQL.
Contents
-
Table Creation and Loading
- create_tables.sql - creation of synthetic customer and email databases
- data_input.sql - data input to customer and email tables with artificial data
-
Normal Forms
- first_normal_form.sql - code used to transform databases into 1NF
- second_normal_form.sql - code used to transform databases into 2NF
- third_normal_form.sql - code used to transform databases into 3NF
-
Queries
- queries.sql - SQL queries that retrieve information of customers and email prospects to target
Software
Note: this code can be adapted to work with the SQL server of your choice.