Advanced SQL for Data Scientists
2h 31mAdvanced2021-05-27
Authors

Dan Sullivan
Enterprise Architect, Big Data Expert
Course details
Many data scientists know how to work with SQL—the industry-standard language for data analysis. But as data sizes grow, you need to know how to do more than simply read and write from a database. This course provides a more sophisticated approach to designing data models and optimizing queries in SQL. Instructor Dan Sullivan begins with the logical and physical design of tables—with particular focus on very large databases—and then presents a deep dive review of indexes, including specialized indexes and when to use them. The next section introduces query optimization and shows how to optimize basic, multi-join, and more complex queries. The course also covers SQL extensions, including user-defined functions and specialized data types. The techniques taught here enable more efficient analysis of large data sets using SQL, statistics, and custom business logic.
Skills covered
PostgreSQLSQLDatabase AdministrationDatabase DevelopmentDatabase ManagementPersonaData AnalysisProgramming LanguagesData ScienceBusiness Analysis and StrategyBusiness Software and ToolsOpen SourceSoftware Development
Concepts
0. Introduction
- 01 - Advanced SQL techniques for data science
- 02 - What you should know
1. Data Modeling - Tables
- 03 - Rules of normalization
- 04 - Denormalization
- 05 - Partitioning data
- 06 - Materialized views
- 07 - Read replicas
- 08 - Challenge - Design a data model for analytics
- 09 - Solution - Design a data model for analytics
2. Data Modeling - Indexes
- 10 - B-tree indexes
- 11 - Bitmap indexes
- 12 - Hash indexes
- 13 - GiST and SP-GiST indexes
- 14 - GIN and BRIN indexes
- 15 - Challenge - Choosing an optimal indexing strategy
- 16 - Solution - Choosing an optimal indexing strategy
3. Query Optimization
- 17 - EXPLAIN and ANALYZE commands
- 18 - Generating data with generate sequence
- 19 - Generating time series data
- 20 - Analyzing a query with WHERE clauses and indexes
- 21 - Analyzing a query with a join
- 22 - Challenge - Optimize a query using an explain plan
- 23 - Solution - Optimize a query using an explain plan
4. User-Defined Functions
- 24 - Extending SQL with user-defined functions
- 25 - SQL query functions
- 26 - Function overloading
- 27 - Function volatility
- 28 - PL Python functions
- 29 - Challenge - Write a user-defined function
- 30 - Solution - Write a user-defined function
5. Special-Purpose Functionality
- 31 - Federated queries
- 32 - Bloom filters
- 33 - Hstore for key-value pairs
- 34 - JSON for semi-structured data
- 35 - Hierarchical data and ltrees
- 36 - Challenge - Design a table to support unstructured data
- 37 - Solution - Design a table to support unstructured data
Conclusion
- 38 - Next steps
Related courses
- Advanced SQL for Data Science: Time Series
- Intermediate SQL for Data Scientists
- Analyzing Big Data with Hive
- Hands-On PostgreSQL Project: Spatial Data Science
- Building Generative AI Apps to Talk to Your Data
- Data Science on Google Cloud Platform: Designing Data Warehouses
- Data Warehousing on Google Cloud Platform
- Hands-On Advanced SQL Server: Strategies and Techniques
Related learn paths
- Master SQL Development
- Master SQL for Data Science
- SQL for Data Professionals in Finance
- Master Advanced Excel Data & Analytics Skills
- Data Engineering Professional Certificate by Snowflake
- Moving from Data Analyst to Data Scientist
- Moving from Data Scientist to Data Analyst
- Advance Your Business Analytics Skills