Understanding the relationship between ActiveRecord and SQL
Why understanding SQL is crucial for Rails developers
Course overview and setup
Basic equality filtering with where
How ActiveRecord translates this to SQL WHERE clauses
Multiple conditions and parameter binding
Using where.not for negation
SQL NOT operator and its nuances
Handling NULL values in negations
Efficient counting with SQL COUNT()
Performance implications of count vs. length vs. size
Counting specific columns and expressions
Using DISTINCT in SQL queries
Performance considerations with distinct
Combining distinct with other query methods
Understanding ActiveRecord::Relation objects
Lazy loading and query execution
Building complex queries with method chaining
How first translates to ORDER BY and LIMIT in SQL
Default ordering by primary key
Customizing with first(n) and first!
How last translates to ORDER BY DESC and LIMIT in SQL
Reverse ordering considerations
Customizing with last(n) and last!
Using find_by for single record retrieval
Differences between find, find_by, and where.first
Error handling with find_by vs. find_by!
Using OR conditions in ActiveRecord queries
SQL OR operator and query optimization
Complex conditions with AND and OR combinations
Understanding the N+1 query problem
Comparing different eager loading strategies
When to use each loading strategy
How includes automatically switches to joins
Filtering associated records with references
Complex nested conditions and their SQL translations
Using group for data aggregation
Filtering grouped results with having
Advanced aggregation techniques
Using merge to combine conditions from different relations
Merging named scopes for cleaner code
Advanced merge techniques with arrays and procs
Course summary and key takeaways
Advanced ActiveRecord and SQL topics to explore
Resources for continued learning
RubyCademy ©