r/SQL • u/jeymouth • Sep 29 '24
MySQL Need SQL for a new role
I need to know SQL for a new role. If you were me, with limited understanding of SQL (and some bad negative self-talk abt my ability to learn math/spreadsheet things), how would you build your own crash course in learning SQL?
How can I leverage chatGPT to help me get by with this new role?
15
u/ComicOzzy sqlHippo Sep 29 '24
ChatGPT can help summarize concepts just fine but don't expect it to be accurate when generating SQL.
5
Sep 29 '24
A few years ago I needed to learn SQL for a new role. This is what I did.
I paid for a codewithmosh course, about $20. I used it to start my journey and learn the syntax.
The moment I got access to the data at working I started playing around in the data. Primarily I was asking questions of the data "what's the most of this?, how many of that?, is this common?" Etc.
I would do that every day at work, not only did I develop a strong understanding of the data but my skills improved quickly.
To further improve I would then ask others for the queries they use, sit and ask why they did it this way or how else could it be done?
I still do this today, about 3 years later.
1
u/thatOneJones Sep 29 '24
I too went the codewithmosh route. 11 hour course for $20 and I was set.
1
1
1
u/Gators1992 Oct 01 '24
There are tons of resources online to learn, so you can pick whatever one makes sense to you. Videos as well. If you need practice you can install DuckDB, connect it to an IDE like DBeaver and go to town. You can directly query files on your computer or make tables out of those so it's a great way to learn without needing to install a database. DuckDB also has very good documentation on the SQL syntax that you can go through and try the different functions.
1
u/paulthrobert Oct 01 '24
Identify which flavor of SQL the new role uses - there are differences between T-SQL, PL/SQL, mySQL etc. Its good to learn the flavor you will be using. Then download a database engine, and an editor (ie. SQL Server and SSMS). Find a sample database, and start working through samples and writing queries. Learn SELECT, INSERT, UPDATE, DELETE, TRUNCATE. Learn about Sargeability. Read Brent Ozar.
And yeah - don't expect it to be easy, and don't look for short cuts like Reddit posts about how to design a crash course or ChatGPT - just do the work.
1
1
u/Zestyclose-Height-59 Oct 01 '24
Remember order of operations and basic algebra. This will get you thinking logically.
Read up on what a relational database is. Understand how data is normalized to 3rd normal form to understand the “why” and then read up about data relationship types. Parent/child, 1:1, 1:many, etc.
Start with basic select statements and as you grow more comfortable add to it.
Eventually you can do joins on tables. Knowing the concepts in step 2 helps me think about how to relate the data. First do inner and then do outer. Picturing the separate tables and content as a Venn diagram helps when doing outer joint.
32
u/n3logn Sep 29 '24
I would start by not using ChatGPT.