Tea Sql Dev (@TeaSqlDev) header
Tea Sql Dev (@TeaSqlDev) profile picture

T-SQL time! Master T-SQL, sip by sip. #tsql

Joined July 2025
Photo by Tea Sql Dev (@TeaSqlDev)
Ready to learn SQL? Start with online tutorials like @Codecademy or @w3schools, practice on platforms like @LeetCode, join communities like @StackOverflow or @redditSQL, and build projects on @github. Stay curious, keep learning, and welcome to the #SQL #datafam! ๐Ÿค“๐Ÿ“Šโœจ
1
3
50
Tea Sql Dev retweeted
SQL vs NoSQL โ€” When to Use What (With Real Examples) A lot of devs struggle with choosing between SQL and NoSQL. Hereโ€™s a no-fluff breakdown that will save you hours of research.
12
139
4
1,084
131,588
Things every developer should know: SQL execution order. A SQL query executes its statements in the following order: 1) FROM / JOIN 2) WHERE 3) GROUP BY 4) HAVING 5) SELECT 6) DISTINCT 7) ORDER BY 8) LIMIT / OFFSET ๐—ง๐—ต๐—ฒ ๐˜๐—ฒ๐—ฐ๐—ต๐—ป๐—ถ๐—พ๐˜‚๐—ฒ๐˜€ ๐˜†๐—ผ๐˜‚ ๐—ถ๐—บ๐—ฝ๐—น๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ฎ๐˜ ๐—ฒ๐—ฎ๐—ฐ๐—ต ๐˜€๐˜๐—ฒ๐—ฝ ๐—ต๐—ฒ๐—น๐—ฝ ๐˜€๐—ฝ๐—ฒ๐—ฒ๐—ฑ ๐˜‚๐—ฝ ๐˜๐—ต๐—ฒ ๐—ณ๐—ผ๐—น๐—น๐—ผ๐˜„๐—ถ๐—ป๐—ด ๐˜€๐˜๐—ฒ๐—ฝ๐˜€. This is why it's important to know their execution order. ๐—ง๐—ผ ๐—บ๐—ฎ๐˜…๐—ถ๐—บ๐—ถ๐˜‡๐—ฒ ๐—ฒ๐—ณ๐—ณ๐—ถ๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐˜†, ๐—ณ๐—ผ๐—ฐ๐˜‚๐˜€ ๐—ผ๐—ป ๐—ผ๐—ฝ๐˜๐—ถ๐—บ๐—ถ๐˜‡๐—ถ๐—ป๐—ด ๐˜๐—ต๐—ฒ ๐˜€๐˜๐—ฒ๐—ฝ๐˜€ ๐—ฒ๐—ฎ๐—ฟ๐—น๐—ถ๐—ฒ๐—ฟ ๐—ถ๐—ป ๐˜๐—ต๐—ฒ ๐—พ๐˜‚๐—ฒ๐—ฟ๐˜†. With that in mind, let's take a look at some ๐—ผ๐—ฝ๐˜๐—ถ๐—บ๐—ถ๐˜‡๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐˜๐—ถ๐—ฝ๐˜€: ๐Ÿญ) ๐— ๐—ฎ๐˜…๐—ถ๐—บ๐—ถ๐˜‡๐—ฒ ๐˜๐—ต๐—ฒ ๐—ช๐—›๐—˜๐—ฅ๐—˜ ๐—ฐ๐—น๐—ฎ๐˜‚๐˜€๐—ฒ This clause is executed early, so it's a good opportunity to reduce the size of your data set before the rest of the query is processed. ๐Ÿฎ) ๐—™๐—ถ๐—น๐˜๐—ฒ๐—ฟ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฟ๐—ผ๐˜„๐˜€ ๐—ฏ๐—ฒ๐—ณ๐—ผ๐—ฟ๐—ฒ ๐—ฎ ๐—๐—ข๐—œ๐—ก Although the FROM/JOIN occurs first, you can still limit the rows. To limit the number of rows you are joining, use a subquery in the FROM statement instead of a table. ๐Ÿฏ) ๐—จ๐˜€๐—ฒ ๐—ช๐—›๐—˜๐—ฅ๐—˜ ๐—ผ๐˜ƒ๐—ฒ๐—ฟ ๐—›๐—”๐—ฉ๐—œ๐—ก๐—š The HAVING clause is executed after WHERE & GROUP BY. This means you're better off moving any appropriate conditions to the WHERE clause when you can. ๐Ÿฐ) ๐——๐—ผ๐—ป'๐˜ ๐—ฐ๐—ผ๐—ป๐—ณ๐˜‚๐˜€๐—ฒ ๐—Ÿ๐—œ๐— ๐—œ๐—ง, ๐—ข๐—™๐—™๐—ฆ๐—˜๐—ง, ๐—ฎ๐—ป๐—ฑ ๐——๐—œ๐—ฆ๐—ง๐—œ๐—ก๐—–๐—ง ๐—ณ๐—ผ๐—ฟ ๐—ผ๐—ฝ๐˜๐—ถ๐—บ๐—ถ๐˜‡๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐˜๐—ฒ๐—ฐ๐—ต๐—ป๐—ถ๐—พ๐˜‚๐—ฒ๐˜€ It's easy to assume that these would boost performance by minimizing the data set, but this isnโ€™t the case. Because they occur at the end of the query, they make little to no impact on its performance. If you want to create efficient queries, it's a good idea to understand how things work under the hood otherwise your efforts may be wasted. While these tips work best in most cases, you should consider your unique use case when choosing the best course of action. ~~ Thank you to our partner Kickresume who keeps our content free to the community. ๐—”๐—ฟ๐—ฒ ๐˜†๐—ผ๐˜‚ ๐˜€๐˜‚๐—ฟ๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฟ๐—ฒ๐˜€๐˜‚๐—บ๐—ฒ ๐—ฝ๐—ฎ๐˜€๐˜€๐—ฒ๐˜€ ๐—”๐—ง๐—ฆ ๐˜€๐—ฐ๐—ฎ๐—ป๐˜€? Check by using Kickresumeโ€™s AI ATS Resume checker. Check it out: lucode.co/ats-resume-checkerโ€ฆ
7
70
1
420
28,664