#sqltips — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #sqltips, aggregated by home.social.
-
Writing SQL queries is easy — but understanding their execution order is what separates good analysts from great ones.
SQL doesn’t run top to bottom; it follows a logical order — FROM → JOIN → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → LIMIT.
Master this flow to debug, optimize, and write smarter queries.
📕 ebokify.com/data-analysis
#SQL #DataAnalytics #Database #DataEngineering #LearnSQL #BusinessIntelligence #Analytics #SQLTips
-
Unleash your inner SQL wizard with FromSql in EF Core!
Need raw SQL power but love EF Core? FromSql lets you write handcrafted SQL like a boss while keeping all the ORM goodness.Learn how: https://woodruff.dev/fromsql-writing-sql-like-a-boss-in-ef-core/
-
Check out these 2 queries:
Query 1:
SELECT ...
FROM t1
JOIN t2 ON t1.id IN (t2.id1, t2.id2);Query 2:
SELECT ...
FROM t1
JOIN t2 ON t1.id = t2.id1
UNION
SELECT ...
FROM t1
JOIN t2 ON t1.id = t2.id2;They both return the same data but since most database engines struggle with OR joins, the latter will outperform the former by at least an order of magnitude.