Skip to content

ipeirotis/introduction-to-databases

Repository files navigation

Databases for Business Analytics

A brief introductory course to relational databases and SQL, targeting people interested in learning SQL for data analysis. This course does not cover database administration topics such as indexing, transactions, or stored procedures.

Platform: Google BigQuery
Datasets: nyu-datasets.imdb and nyu-datasets.facebook


Course Videos

Full YouTube Playlist


Modules

  • Entities, Primary Keys, and Attributes
  • Relations and Cardinality (One-to-One, One-to-Many, Many-to-Many)
  • From ER Diagram to Relational Schema
  • SQL Statements for Creating Tables
  • Navigating a Database
  • Selection queries: SELECT, AS, DISTINCT, ORDER BY, LIMIT
  • Filtering with WHERE: Boolean operators, IN, LIKE, BETWEEN
  • Handling NULL values
  • Conditional logic with CASE WHEN
  • Attribute-level functions: string, date, and NULL functions
  • Inner Joins
  • Self Joins
  • Outer Joins (LEFT, RIGHT, FULL)
  • Semi-joins and Anti-joins
  • Aggregation functions: COUNT, SUM, AVG, MAX, MIN, STDEV
  • GROUP BY on single and multiple attributes
  • Filtering groups with HAVING
  • Combining JOINs and GROUP BY
  • Subqueries with single-value results
  • Semi-joins and Anti-joins using IN
  • Derived tables
  • WITH clause (Common Table Expressions)
  • Comparison: CTEs vs. temporary tables vs. views
  • Window definition: OVER(ORDER BY)
  • Ranking functions: RANK, DENSE_RANK, ROW_NUMBER
  • Partitioned windows: OVER(PARTITION BY ... ORDER BY ...)
  • Offset functions: LEAD, LAG, FIRST_VALUE, LAST_VALUE
  • Frame definitions and rolling aggregations

Additional Resources

Practice Platforms

Tutorials

Books & Guides


Setup

All notebooks use Google BigQuery. To run them:

  1. Open any notebook in Google Colab (use the badge above)
  2. Authenticate with your Google account
  3. Replace 'your-project-id' with your Google Cloud project ID

The queries use publicly accessible datasets in the nyu-datasets project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •