autodidact is how 95% of people (have to) learn any computer programmy things. Our society is not built around accessible education or mutual teaching, which sucks.
SQL is a weird, mostly declarative language. A useful and good one, but it's a little harder to intuitively grasp than an imperative language. In an imperative language, you tell the computer what to do, step-by-step (create a variable with value 3, multiply it by 2, keep multiplying it by itself until it's greater than 1000). In a declarative language you say what relationships and results you want to see and the computer figures out how to get there for you. The latter hides more things from you, so what you're really learning is how to tweak the declarations for this one particular language and it's idiosyncrasies.
I would usually recommend learning an imperative language first, if you have the time and interest, because it's more intuitive and you'll pick up some concepts that carry over like data types, inputs and results. Common imperative languages to start with are Python, JavaScript, or Java.
If you'd prefer to just go straight to SQL, which is 100% legitimate, I'd definitely recommend some kind of quasi-interactive course-like material that teaches you pieces at a time, then has you apply them to realistic examples. Like others mentioned, it's also important to have a project where you want to use these skills. This is important for both learning and motivation. Your project will concretize the language and lead to a lot of Googling, which is 80% of how programmers figure out what to do when they hit a snag. A project will also tie into your motivations and keep you going: you're probably either trying to make something that you already use better or you want to accomplish something at your job/hobby that's otherwise impossible or you want to get a different kind of job than the one you have now, in which case your project is a resume-builder.
Good comment. IMO, SQL is basically useless on its own. It is a highly marketable and useful skill, but it is hard to learn in a vacuum. It is always being used as a tool in the context of accomplishing some broader goal, and those goals will strongly influence they way SQL is employed. Relational databases are a very important component of applications which need to store vast amounts of categorized data, but you will have no fun sitting in front of a Postgres/MySQL command prompt manually typing in fake entries for a fake schema for a fake inventory / billing application.
To make the most out of relational databases, you need to fiddle around with an application which USES data. This means learning some other programming language like Python, Ruby, Java, C#, Rust, etc. No need to master it, just learn enough get a gist of what it's doing. Write a script in one of these languages to fill up a database with some interesting information, or play around with an already-existing application which makes use of a database.
For instance, there are a bunch of open source media players that read tags from your media library and store them in a sqlite database for faster start-up. Try cracking that thing open and playing around with it (either from the software side or the database side). See how changes to the database are reflected in the software. See how changes in the software are reflected in the database. See how a somewhat advanced (but not enterprise scale) database is organized.
You can also try playing with a vast array of software designed for the web. Content Management Systems like WordPress and Drupal, message boards like SMF, social media software like Lemmy or Mastodon, Wiki software like MediaWiki. These all use relational databases via SQL queries under the hood, and the schemas / queries they employ are heavily optimized.
Iunno if this helps, but I always learned by cracking things open and having fun with it.
I'm not necessarily sure I'd agree that imperative would be easier to learn, unless you're digging deep into query plans and extreme optimization in SQL.
SQL has a relatively readable English-like syntax which is likely more familiar to beginners, and doesn't have to deal with Object Oriented Programming. Plus, I find declarative a lot more intuitive, especially for beginners, since you focus on what you want the computer to achieve, without as much care about how the computer does so.
Well my impression here is based on meeting a ton of people who have trouble learning SQL directly - or learn a little SQL and then give up because they "don't get it", vs. lots of folks who know one imperative language and then picked up SQL very easily.
Basically... there are a lot of people who are almost there in terms of being able to be good at SQL or generalize into making more through data analysis that requires dipping into imperative programming. It's like they hit a wall at mediocre SQL skills. I think this draws from not having a solid basis on which to build out their skills, instead just getting enough of what is basically a DSL for relational querying to be dangerous but not knowing where else to go from there. These folks find that situation discouraging and frustrating and I always put them down the Python or JavaScript path and it tends to work.
autodidact is how 95% of people (have to) learn any computer programmy things. Our society is not built around accessible education or mutual teaching, which sucks.
SQL is a weird, mostly declarative language. A useful and good one, but it's a little harder to intuitively grasp than an imperative language. In an imperative language, you tell the computer what to do, step-by-step (create a variable with value 3, multiply it by 2, keep multiplying it by itself until it's greater than 1000). In a declarative language you say what relationships and results you want to see and the computer figures out how to get there for you. The latter hides more things from you, so what you're really learning is how to tweak the declarations for this one particular language and it's idiosyncrasies.
I would usually recommend learning an imperative language first, if you have the time and interest, because it's more intuitive and you'll pick up some concepts that carry over like data types, inputs and results. Common imperative languages to start with are Python, JavaScript, or Java.
If you'd prefer to just go straight to SQL, which is 100% legitimate, I'd definitely recommend some kind of quasi-interactive course-like material that teaches you pieces at a time, then has you apply them to realistic examples. Like others mentioned, it's also important to have a project where you want to use these skills. This is important for both learning and motivation. Your project will concretize the language and lead to a lot of Googling, which is 80% of how programmers figure out what to do when they hit a snag. A project will also tie into your motivations and keep you going: you're probably either trying to make something that you already use better or you want to accomplish something at your job/hobby that's otherwise impossible or you want to get a different kind of job than the one you have now, in which case your project is a resume-builder.
Good comment. IMO, SQL is basically useless on its own. It is a highly marketable and useful skill, but it is hard to learn in a vacuum. It is always being used as a tool in the context of accomplishing some broader goal, and those goals will strongly influence they way SQL is employed. Relational databases are a very important component of applications which need to store vast amounts of categorized data, but you will have no fun sitting in front of a Postgres/MySQL command prompt manually typing in fake entries for a fake schema for a fake inventory / billing application.
To make the most out of relational databases, you need to fiddle around with an application which USES data. This means learning some other programming language like Python, Ruby, Java, C#, Rust, etc. No need to master it, just learn enough get a gist of what it's doing. Write a script in one of these languages to fill up a database with some interesting information, or play around with an already-existing application which makes use of a database.
For instance, there are a bunch of open source media players that read tags from your media library and store them in a sqlite database for faster start-up. Try cracking that thing open and playing around with it (either from the software side or the database side). See how changes to the database are reflected in the software. See how changes in the software are reflected in the database. See how a somewhat advanced (but not enterprise scale) database is organized.
You can also try playing with a vast array of software designed for the web. Content Management Systems like WordPress and Drupal, message boards like SMF, social media software like Lemmy or Mastodon, Wiki software like MediaWiki. These all use relational databases via SQL queries under the hood, and the schemas / queries they employ are heavily optimized.
Iunno if this helps, but I always learned by cracking things open and having fun with it.
I'm not necessarily sure I'd agree that imperative would be easier to learn, unless you're digging deep into query plans and extreme optimization in SQL.
SQL has a relatively readable English-like syntax which is likely more familiar to beginners, and doesn't have to deal with Object Oriented Programming. Plus, I find declarative a lot more intuitive, especially for beginners, since you focus on what you want the computer to achieve, without as much care about how the computer does so.
Well my impression here is based on meeting a ton of people who have trouble learning SQL directly - or learn a little SQL and then give up because they "don't get it", vs. lots of folks who know one imperative language and then picked up SQL very easily.
Basically... there are a lot of people who are almost there in terms of being able to be good at SQL or generalize into making more through data analysis that requires dipping into imperative programming. It's like they hit a wall at mediocre SQL skills. I think this draws from not having a solid basis on which to build out their skills, instead just getting enough of what is basically a DSL for relational querying to be dangerous but not knowing where else to go from there. These folks find that situation discouraging and frustrating and I always put them down the Python or JavaScript path and it tends to work.