
Tea Sql Dev retweeted
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! ๐ค๐โจ
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.
Tea Sql Dev retweeted
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โฆ




