How To Learn SQL In 2023
HTML-код
- Опубликовано: 28 май 2024
- How do I learn SQL in 2023? Is it something I should know? These are great questions to ask, especially if you work with C#. Microsoft SQL is a popular database type that is a great blend of power, security, and accessibility.
In this video, I am going to cover why Microsoft SQL is special, what order you should learn SQL in, and what steps to take to learn most effectively. I will also cover the easy path to learning SQL, as well as some tips and tricks to make the most of your education.
Full Training Courses: www.IAmTimCorey.com
Mailing List: signup.iamtimcorey.com/
Today I realized I don't know SQL at all. I mostly use ORM and If I need some more complex query it is usually couple of joins with few where clauses. Today I needed to write some partition by and use CTE (never heard of it before) and I LOLed, spent whole day writing 11 lines of code.
Knowing the system that your entire application depends on is really important. Now that you know, you can take the time to broaden your knowledge in SQL. That will really help you write better applications.
Love SQL and even after 20+ years I still learn new things about it
Excellent!
Thank you Tim. Your videos have helped me a lot.
You are welcome.
Great 👍
Thank you!
Thank you Tim. Thank you so MUCH for Great contents I love them 😍🙏
You are welcome.
@@IAmTimCorey Great content, I would really like to see in the future more advanced and in-depth SQL Tutorials, Even though i mainly use ORACLE Database but i found this video very usefull, Do this roadmap also applies to ORACLE ?
man.. tim's videos are A1. Wish I had the cashish to buy all of his courses.
Thanks!
Hi Tim, can you also create a video regarding naming convention for creating SQL databases? thanks.
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
I think I have to dig up my old intel macbook pro to do some MS SQL development in Bootcamp on Win 10. This is because my M1 doesn't seem to yet upport nested virtualization in order to use Docker inside a Win 11 arm guest OS?
Not sure about that. You can do SQL on Linux in Docker, though, so you could use it in your Mac OS unless there is another need for Windows.
Excellent
Thanks!
Heading to your website now 😊
Great!
SQL is not "easy to use", I would say it is easy to do the basics when a Db is setup in a logical way but has a steep learning curve as an application becomes more complex or is poorly architected.
Unlike a programming language, SQL is optimized behind the scenes and can run quicker after the first execution giving false performance metrics. My C# and JS code runs the same regardless of how many times I run the function/method :)
Fragmentation is a real problem in Microsoft SQL server that requires automating some maintenance tasks such as running SP_Updatestats, which is a stored procedure that updates the statistics of all the tables and indexes in the current database. It is necessary to do this regularly to keep the query optimizer using up-to-date information for optimization decisions. Updating the statistics ensures that the query optimizer can make better decisions that result in better query performance.
Additionally, some automated tasks to defragment the indexes of your tables periodically is also required as Microsoft SQL server is really bad at preventing database indexes from becoming heavily fragmented as changes are made to the application's databases.
@@nathanaelries9783 From my experience, software developers make pretty bad DBA's even if they "know" what they're doing. Unless a dev spends half their time in the Db it would be difficult to pick up on the nuances that can make a query performant.
@@DevMeloy Agreed. For developers who don't want to become DBAs, PostgreSQL is the better choice. While both PostgreSQL and SQL Server are capable of preventing index fragmentation, PostgreSQL is better at preventing database index fragmentation than SQL Server due to its advanced features such as HOT tuples, Bottom-up index tuple deletion, Vacuum and Autovacuum. Autovacuum automatically reindexes databases, which helps to prevent fragmentation. Additionally, PostgreSQL supports multiple index types that can be used to better optimize database performance and prevent fragmentation.
As I stated in the video, it is the basics of SQL that are easy to use, especially when you are talking about what a developer needs to do. A developer needs to know how to write good T-SQL statements for CRUD access. Obviously, the more they know, the better. That's why I teach about execution plans and more. By the way, SQL doesn't give false performance metrics. It gives you exactly what it knows before it executes and exactly what it did after it executes. In between, it can learn and adapt based upon the difference between what it knew and what reality is.
@@IAmTimCorey What I meant about false performance metrics is that the first time a query is ran will typically be slower than the subsequent calls to the same query. This can give a newer developer the impression that the SQL they just wrote is performant.
I don't like absolutes, but dev's typically make bad Dba's. Even simple queries will bring an app to its knees after the userbase increases.
I'm good at SQL and know dev's that are great at SQL, and have seen Dba's come and show how little we actually know :)
can you explain how can indexs be bad and could slow the database?
Sure. An index is basically a smaller version of the table (WAY oversimplification here). So, let's say you have 10 indexes on a table. When you insert the data, it has to be inserted into the primary index (the primary key-sorted physical storage on disk). Then, that same data (or parts of it) have to be inserted in each index. Each time, it has to determine where that particular data goes, based upon the ordering of the index. So essentially, 10 additional indexes means 10 additional writes. Now again, this is an over-simplification, but that's how indexes work. They store another list of data sorted in a different way with references to the particular rows in the table. As the number of indexes get higher, or as the indexes get more complex, the amount of time it takes to write to the database greatly increases. The read speed can be much faster, though. So, indexes are a balancing act. You try to hit the perfect balance for your particular database usage. If you are doing a ton of writes and not many reads, it is probably better to have few indexes. If you are doing a ton of different reads and updating very little, more indexes are probably the way to go. In most situations, it is somewhere in the middle. That's why you cannot just accept an index recommendation from SQL - it isn't taking into account how often you run that type of query vs how slow your writes already are.
@@IAmTimCorey Thank you so much for the deep dive explination! i have never thought about it this way!!!
So many choices out there, Dapper, SQL, EF...
Yep
Are your courses Mac friendly?
I don't have any courses where I teach on a Mac, but quite a bit of my content can be done on a Mac. For instance, most of the C# Mastercourse, all of Blazor Server, all of ASP.NET Core, and more can be done using a Mac.
Why is it pronounced Sequel and not S.Q.L ?
Where did it come from?
Both are valid. The original product that it is based upon was called Sequel. Then, they got into a naming conflict with an existing product (unrelated) so they renamed it SQL. Both pronunciations are common today.
Bro pls upload MVC and web application learn road map. I'm beginner, so pls give some contents worthy.
Thanks for the suggestion.
No, SQL Does not simply refer to Microsoft SQL. Other providers include Oracle, MySQL, PostgreSQL, and IBM DB2.
SQL (Structured Query Language) was invented in 1974 by IBM.
Microsoft employees may try to claim that "SQL = Microsoft" and that SQL is a Microsoft-developed technology. Microsoft is the creator and primary provider of Microsoft SQL Server database software, which is used to store and manage data. Microsoft has invested heavily in the development of the technology and has been the primary provider of Microsoft SQL Server since its release in 1989. As a result, Microsoft has an obvious vested interest in claiming that SQL is their technology.
I cover that in the video.
Yeah I agree.. at the starting point of my cs journey, i learned oracle, back then i thought sql is developed by oracle.